Replace error with warning for failed user actions

This commit is contained in:
Alicia Sykes 2021-09-19 21:29:39 +01:00
parent 6e0cda8709
commit cdab7981bd
2 changed files with 7 additions and 5 deletions

View File

@ -66,7 +66,7 @@ import IconBackup from '@/assets/interface-icons/config-backup.svg';
import IconRestore from '@/assets/interface-icons/config-restore.svg'; import IconRestore from '@/assets/interface-icons/config-restore.svg';
import { backup, update, restore } from '@/utils/CloudBackup'; import { backup, update, restore } from '@/utils/CloudBackup';
import { localStorageKeys } from '@/utils/defaults'; import { localStorageKeys } from '@/utils/defaults';
import ErrorHandler, { InfoHandler } from '@/utils/ErrorHandler'; import { InfoHandler, WarningInfoHandler } from '@/utils/ErrorHandler';
export default { export default {
name: 'CloudBackupRestore', name: 'CloudBackupRestore',
@ -161,7 +161,7 @@ export default {
this.backupPassword = ''; this.backupPassword = '';
}, },
showErrorMsg(errorMsg) { showErrorMsg(errorMsg) {
ErrorHandler(errorMsg); WarningInfoHandler(errorMsg, 'Cloud Backup');
this.$toasted.show(errorMsg, { className: 'toast-error' }); this.$toasted.show(errorMsg, { className: 'toast-error' });
}, },
showSuccessMsg(msg) { showSuccessMsg(msg) {

View File

@ -76,7 +76,7 @@ import router from '@/router';
import Button from '@/components/FormElements/Button'; import Button from '@/components/FormElements/Button';
import Input from '@/components/FormElements/Input'; import Input from '@/components/FormElements/Input';
import Defaults, { localStorageKeys } from '@/utils/defaults'; import Defaults, { localStorageKeys } from '@/utils/defaults';
import { InfoHandler } from '@/utils/ErrorHandler'; import { InfoHandler, WarningInfoHandler } from '@/utils/ErrorHandler';
import { import {
checkCredentials, checkCredentials,
login, login,
@ -160,7 +160,7 @@ export default {
this.goHome(); this.goHome();
InfoHandler(`Succesfully signed in as ${this.username}`, 'Authentication'); InfoHandler(`Succesfully signed in as ${this.username}`, 'Authentication');
} else { } else {
InfoHandler(`Unable to Sign In - ${this.message}`, 'Authentication'); WarningInfoHandler('Unable to Sign In', 'Authentication', this.message);
} }
}, },
/* Calls function to double-check guest access enabled, then log in as guest */ /* Calls function to double-check guest access enabled, then log in as guest */
@ -168,9 +168,11 @@ export default {
const isAllowed = this.isGuestAccessEnabled; const isAllowed = this.isGuestAccessEnabled;
if (isAllowed) { if (isAllowed) {
this.$toasted.show('Logged in as Guest, Redirecting...', { className: 'toast-success' }); this.$toasted.show('Logged in as Guest, Redirecting...', { className: 'toast-success' });
InfoHandler('Logged in as Guest', 'Authentication');
this.goHome(); this.goHome();
} else { } else {
this.$toasted.show('Guest access not allowed', { className: 'toast-error' }); this.$toasted.show('Guest Access Not Allowed', { className: 'toast-error' });
WarningInfoHandler('Guest Access Not Allowed', 'Authentication');
} }
}, },
/* Calls logout, shows status message, and refreshed page */ /* Calls logout, shows status message, and refreshed page */