enhance(frontend): モデレーターがセンシティブ設定を変更する際に確認ダイアログを出すように (#15462)
* enhance(frontend): モデレーターがセンシティブ設定を変更する際に確認ダイアログを出すように * use MkSwitch * Update Changelog
This commit is contained in:
		@@ -124,11 +124,21 @@ function showMenu(ev: MouseEvent) {
 | 
			
		||||
 | 
			
		||||
	if (iAmModerator) {
 | 
			
		||||
		menuItems.push({
 | 
			
		||||
			text: i18n.ts.markAsSensitive,
 | 
			
		||||
			text: props.image.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive,
 | 
			
		||||
			icon: 'ti ti-eye-exclamation',
 | 
			
		||||
			danger: true,
 | 
			
		||||
			action: () => {
 | 
			
		||||
				os.apiWithDialog('drive/files/update', { fileId: props.image.id, isSensitive: true });
 | 
			
		||||
			action: async () => {
 | 
			
		||||
				const { canceled } = await os.confirm({
 | 
			
		||||
					type: 'warning',
 | 
			
		||||
					text: props.image.isSensitive ? i18n.ts.unmarkAsSensitiveConfirm : i18n.ts.markAsSensitiveConfirm,
 | 
			
		||||
				});
 | 
			
		||||
 | 
			
		||||
				if (canceled) return;
 | 
			
		||||
 | 
			
		||||
				os.apiWithDialog('drive/files/update', {
 | 
			
		||||
					fileId: props.image.id,
 | 
			
		||||
					isSensitive: !props.image.isSensitive,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user