enhance(client): show confirm dialog when logout
This commit is contained in:
		| @@ -32,6 +32,7 @@ import { unisonReload } from '@/scripts/unison-reload'; | ||||
| import { instance } from '@/instance'; | ||||
| import { useRouter } from '@/router'; | ||||
| import { definePageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; | ||||
| import * as os from '@/os'; | ||||
|  | ||||
| const props = withDefaults(defineProps<{ | ||||
|   initialPage?: string; | ||||
| @@ -181,7 +182,12 @@ const menuDef = computed(() => [{ | ||||
| 		type: 'button', | ||||
| 		icon: 'fas fa-sign-in-alt fa-flip-horizontal', | ||||
| 		text: i18n.ts.logout, | ||||
| 		action: () => { | ||||
| 		action: async () => { | ||||
| 			const { canceled } = await os.confirm({ | ||||
| 				type: 'warning', | ||||
| 				text: i18n.ts.logoutConfirm, | ||||
| 			}); | ||||
| 			if (canceled) return; | ||||
| 			signout(); | ||||
| 		}, | ||||
| 		danger: true, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo