mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Fix copy to clipboard
This commit is contained in:
@@ -391,30 +391,23 @@ function openExternalLink(link) {
|
|||||||
distinguishCancelAndClose: true,
|
distinguishCancelAndClose: true,
|
||||||
confirmButtonText: 'Open',
|
confirmButtonText: 'Open',
|
||||||
cancelButtonText: 'Copy',
|
cancelButtonText: 'Copy',
|
||||||
type: 'info'
|
type: 'info',
|
||||||
|
beforeClose: (action, instance, done) => {
|
||||||
|
if (action === 'cancel') {
|
||||||
|
copyToClipboard(link);
|
||||||
|
}
|
||||||
|
done();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then((action) => {
|
.then((action) => {
|
||||||
|
console.log(action);
|
||||||
if (action === 'confirm') {
|
if (action === 'confirm') {
|
||||||
AppApi.OpenLink(link);
|
AppApi.OpenLink(link);
|
||||||
} else if (action === 'cancel') {
|
|
||||||
copyLink(link);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {string} text
|
|
||||||
*/
|
|
||||||
function copyLink(text) {
|
|
||||||
ElMessage({
|
|
||||||
message: 'Link copied to clipboard',
|
|
||||||
type: 'success'
|
|
||||||
});
|
|
||||||
copyToClipboard(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {object} ref
|
* @param {object} ref
|
||||||
@@ -541,7 +534,6 @@ export {
|
|||||||
buildTreeData,
|
buildTreeData,
|
||||||
replaceBioSymbols,
|
replaceBioSymbols,
|
||||||
openExternalLink,
|
openExternalLink,
|
||||||
copyLink,
|
|
||||||
getBundleDateSize,
|
getBundleDateSize,
|
||||||
openFolderGeneric,
|
openFolderGeneric,
|
||||||
debounce
|
debounce
|
||||||
|
|||||||
@@ -662,6 +662,9 @@ export const useAuthStore = defineStore('Auth', () => {
|
|||||||
inputErrorMessage: t('prompt.totp.input_error'),
|
inputErrorMessage: t('prompt.totp.input_error'),
|
||||||
beforeClose: (action, instance, done) => {
|
beforeClose: (action, instance, done) => {
|
||||||
state.twoFactorAuthDialogVisible = false;
|
state.twoFactorAuthDialogVisible = false;
|
||||||
|
if (action === 'cancel') {
|
||||||
|
promptOTP();
|
||||||
|
}
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -672,15 +675,12 @@ export const useAuthStore = defineStore('Auth', () => {
|
|||||||
code: value.trim()
|
code: value.trim()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
clearCookiesTryLogin();
|
clearCookiesTryLogin();
|
||||||
throw err;
|
|
||||||
})
|
})
|
||||||
.then((args) => {
|
.then(() => {
|
||||||
userStore.getCurrentUser();
|
userStore.getCurrentUser();
|
||||||
return args;
|
|
||||||
});
|
});
|
||||||
} else if (action === 'cancel') {
|
|
||||||
promptOTP();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -702,6 +702,9 @@ export const useAuthStore = defineStore('Auth', () => {
|
|||||||
inputErrorMessage: t('prompt.otp.input_error'),
|
inputErrorMessage: t('prompt.otp.input_error'),
|
||||||
beforeClose: (action, instance, done) => {
|
beforeClose: (action, instance, done) => {
|
||||||
state.twoFactorAuthDialogVisible = false;
|
state.twoFactorAuthDialogVisible = false;
|
||||||
|
if (action === 'cancel') {
|
||||||
|
promptTOTP();
|
||||||
|
}
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,15 +715,12 @@ export const useAuthStore = defineStore('Auth', () => {
|
|||||||
code: value.trim()
|
code: value.trim()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
clearCookiesTryLogin();
|
clearCookiesTryLogin();
|
||||||
throw err;
|
|
||||||
})
|
})
|
||||||
.then((args) => {
|
.then(() => {
|
||||||
userStore.getCurrentUser();
|
userStore.getCurrentUser();
|
||||||
return args;
|
|
||||||
});
|
});
|
||||||
} else if (action === 'cancel') {
|
|
||||||
promptTOTP();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -743,6 +743,10 @@ export const useAuthStore = defineStore('Auth', () => {
|
|||||||
inputErrorMessage: t('prompt.email_otp.input_error'),
|
inputErrorMessage: t('prompt.email_otp.input_error'),
|
||||||
beforeClose: (action, instance, done) => {
|
beforeClose: (action, instance, done) => {
|
||||||
state.twoFactorAuthDialogVisible = false;
|
state.twoFactorAuthDialogVisible = false;
|
||||||
|
if (action === 'cancel') {
|
||||||
|
resendEmail2fa();
|
||||||
|
return;
|
||||||
|
}
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -753,15 +757,12 @@ export const useAuthStore = defineStore('Auth', () => {
|
|||||||
code: value.trim()
|
code: value.trim()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
promptEmailOTP();
|
promptEmailOTP();
|
||||||
throw err;
|
|
||||||
})
|
})
|
||||||
.then((args) => {
|
.then(() => {
|
||||||
userStore.getCurrentUser();
|
userStore.getCurrentUser();
|
||||||
return args;
|
|
||||||
});
|
});
|
||||||
} else if (action === 'cancel') {
|
|
||||||
resendEmail2fa();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user