fix: copy token to search input if clipboard.writeText is not available (close #6)

This commit is contained in:
JustSong
2023-04-25 09:46:58 +08:00
parent 5ed4a3d405
commit 423978baf4
3 changed files with 9 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ export function isMobile() {
}
let showErrorOptions = { autoClose: toastConstants.ERROR_TIMEOUT };
let showWarningOptions = { autoClose: toastConstants.WARNING_TIMEOUT };
let showSuccessOptions = { autoClose: toastConstants.SUCCESS_TIMEOUT };
let showInfoOptions = { autoClose: toastConstants.INFO_TIMEOUT };
let showNoticeOptions = { autoClose: false };
@@ -74,6 +75,10 @@ export function showError(error) {
}
}
export function showWarning(message) {
toast.warn(message, showWarningOptions);
}
export function showSuccess(message) {
toast.success(message, showSuccessOptions);
}