Catch closing dialogs

This commit is contained in:
Natsumi
2025-10-17 11:27:19 +11:00
parent 529c6c2b04
commit 9e95e1734c
5 changed files with 99 additions and 85 deletions

View File

@@ -604,7 +604,8 @@ export const useAuthStore = defineStore('Auth', () => {
}) })
.finally(() => { .finally(() => {
loginForm.value.loading = false; loginForm.value.loading = false;
}); })
.catch(() => {});
return args; return args;
} }
authLogin({ authLogin({
@@ -645,7 +646,8 @@ export const useAuthStore = defineStore('Auth', () => {
done(); done();
} }
} }
).then(({ value, action }) => { )
.then(({ value, action }) => {
if (action === 'confirm') { if (action === 'confirm') {
authRequest authRequest
.verifyTOTP({ .verifyTOTP({
@@ -659,7 +661,8 @@ export const useAuthStore = defineStore('Auth', () => {
userStore.getCurrentUser(); userStore.getCurrentUser();
}); });
} }
}); })
.catch(() => {});
} }
function promptOTP() { function promptOTP() {
@@ -685,7 +688,8 @@ export const useAuthStore = defineStore('Auth', () => {
done(); done();
} }
} }
).then(({ value, action }) => { )
.then(({ value, action }) => {
if (action === 'confirm') { if (action === 'confirm') {
authRequest authRequest
.verifyOTP({ .verifyOTP({
@@ -699,7 +703,8 @@ export const useAuthStore = defineStore('Auth', () => {
userStore.getCurrentUser(); userStore.getCurrentUser();
}); });
} }
}); })
.catch(() => {});
} }
function promptEmailOTP() { function promptEmailOTP() {
@@ -727,7 +732,8 @@ export const useAuthStore = defineStore('Auth', () => {
done(); done();
} }
} }
).then(({ value, action }) => { )
.then(({ value, action }) => {
if (action === 'confirm') { if (action === 'confirm') {
authRequest authRequest
.verifyEmailOTP({ .verifyEmailOTP({
@@ -741,7 +747,8 @@ export const useAuthStore = defineStore('Auth', () => {
userStore.getCurrentUser(); userStore.getCurrentUser();
}); });
} }
}); })
.catch(() => {});
} }
/** /**

View File

@@ -417,14 +417,16 @@ export const usePhotonStore = defineStore('Photon', () => {
'prompt.overlay_message_timeout.input_error' 'prompt.overlay_message_timeout.input_error'
) )
} }
).then(({ value, action }) => { )
.then(({ value, action }) => {
if (action === 'confirm' && value && !isNaN(Number(value))) { if (action === 'confirm' && value && !isNaN(Number(value))) {
state.photonOverlayMessageTimeout = Math.trunc( state.photonOverlayMessageTimeout = Math.trunc(
Number(value) * 1000 Number(value) * 1000
); );
vrStore.updateVRConfigVars(); vrStore.updateVRConfigVars();
} }
}); })
.catch(() => {});
} }
function promptPhotonLobbyTimeoutThreshold() { function promptPhotonLobbyTimeoutThreshold() {
@@ -441,13 +443,15 @@ export const usePhotonStore = defineStore('Photon', () => {
inputPattern: /\d+$/, inputPattern: /\d+$/,
inputErrorMessage: t('prompt.photon_lobby_timeout.input_error') inputErrorMessage: t('prompt.photon_lobby_timeout.input_error')
} }
).then(({ value, action }) => { )
.then(({ value, action }) => {
if (action === 'confirm' && value && !isNaN(Number(value))) { if (action === 'confirm' && value && !isNaN(Number(value))) {
state.photonLobbyTimeoutThreshold = Math.trunc( state.photonLobbyTimeoutThreshold = Math.trunc(
Number(value) * 1000 Number(value) * 1000
); );
} }
}); })
.catch(() => {});
} }
function startLobbyWatcherLoop() { function startLobbyWatcherLoop() {

View File

@@ -339,17 +339,21 @@ export const useSearchStore = defineStore('Search', () => {
inputPattern: /\S+/, inputPattern: /\S+/,
inputErrorMessage: t('prompt.direct_access_omni.input_error') inputErrorMessage: t('prompt.direct_access_omni.input_error')
} }
).then(({ value, action }) => { )
.then(({ value, action }) => {
if (action === 'confirm' && value) { if (action === 'confirm' && value) {
const input = value.trim(); const input = value.trim();
if (!directAccessParse(input)) { if (!directAccessParse(input)) {
ElMessage({ ElMessage({
message: t('prompt.direct_access_omni.message.error'), message: t(
'prompt.direct_access_omni.message.error'
),
type: 'error' type: 'error'
}); });
} }
} }
}); })
.catch(() => {});
} }
function showGroupDialogShortCode(shortCode) { function showGroupDialogShortCode(shortCode) {

View File

@@ -186,17 +186,18 @@
await updateRegistryBackupDialog(); await updateRegistryBackupDialog();
} }
async function promptVrcRegistryBackupName() { function promptVrcRegistryBackupName() {
try { ElMessageBox.prompt('Enter a name for the backup', 'Backup Name', {
const { value } = await ElMessageBox.prompt('Enter a name for the backup', 'Backup Name', {
confirmButtonText: 'Confirm', confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel', cancelButtonText: 'Cancel',
inputPattern: /\S+/, inputPattern: /\S+/,
inputErrorMessage: 'Name is required', inputErrorMessage: 'Name is required',
inputValue: 'Backup' inputValue: 'Backup'
}); })
await handleBackupVrcRegistry(value); .then(({ value }) => {
} catch (error) {} handleBackupVrcRegistry(value);
})
.catch(() => {});
} }
async function openJsonFileSelectorDialogElectron() { async function openJsonFileSelectorDialogElectron() {

View File

@@ -1131,8 +1131,6 @@
}); });
} }
}) })
.catch(() => { .catch(() => {});
// on cancel
});
} }
</script> </script>