Make some messages appear longer/permanently
This commit is contained in:
parent
d3ef16b947
commit
d228d1194a
|
@ -37,7 +37,7 @@ export function logIn() {
|
||||||
const loginModal = document.getElementById('loginModal');
|
const loginModal = document.getElementById('loginModal');
|
||||||
loginModal.parentElement.removeChild(loginModal);
|
loginModal.parentElement.removeChild(loginModal);
|
||||||
triggerLoginChanges();
|
triggerLoginChanges();
|
||||||
addMessage(`Welcome${window.account.publicName !== '' ? ', ' + window.account.publicName : ''}! You are logged in.`);
|
addMessage(`Welcome${window.account.publicName !== '' ? ', ' + window.account.publicName : ''}! You are logged in.`, 0);
|
||||||
syncDictionary();
|
syncDictionary();
|
||||||
}
|
}
|
||||||
}).catch(err => console.error(err));
|
}).catch(err => console.error(err));
|
||||||
|
@ -106,7 +106,7 @@ export function createAccount() {
|
||||||
loginModal.parentElement.removeChild(loginModal);
|
loginModal.parentElement.removeChild(loginModal);
|
||||||
triggerLoginChanges();
|
triggerLoginChanges();
|
||||||
addMessage('Account Created Successfully!');
|
addMessage('Account Created Successfully!');
|
||||||
addMessage(`Welcome${publicName !== '' ? ', ' + publicName : ''}! You are logged in.`);
|
addMessage(`Welcome${publicName !== '' ? ', ' + publicName : ''}! You are logged in.`, 0);
|
||||||
if (window.currentDictionary.hasOwnProperty('externalID')) {
|
if (window.currentDictionary.hasOwnProperty('externalID')) {
|
||||||
// Ensure dictionary uploads to overwrite the auto-created default dictionary
|
// Ensure dictionary uploads to overwrite the auto-created default dictionary
|
||||||
delete window.currentDictionary.externalID;
|
delete window.currentDictionary.externalID;
|
||||||
|
@ -125,7 +125,7 @@ export function validateToken() {
|
||||||
}, userData => {
|
}, userData => {
|
||||||
window.account = userData;
|
window.account = userData;
|
||||||
triggerLoginChanges();
|
triggerLoginChanges();
|
||||||
addMessage(`Welcome${window.account.publicName !== '' ? ', ' + window.account.publicName : ''}! You are logged in.`, 10000);
|
addMessage(`Welcome${window.account.publicName !== '' ? ', ' + window.account.publicName : ''}! You are logged in.`, 0);
|
||||||
syncDictionary();
|
syncDictionary();
|
||||||
}, error => {
|
}, error => {
|
||||||
addMessage(error + '. Logging Out.', undefined, 'error');
|
addMessage(error + '. Logging Out.', undefined, 'error');
|
||||||
|
|
|
@ -149,7 +149,9 @@ export function addMessage(messageText, time = 5000, extraClass = false) {
|
||||||
};
|
};
|
||||||
closeButton.addEventListener('click', closeMessage);
|
closeButton.addEventListener('click', closeMessage);
|
||||||
|
|
||||||
|
if (time > 0) {
|
||||||
setTimeout(closeMessage, time);
|
setTimeout(closeMessage, time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hideAllModals() {
|
export function hideAllModals() {
|
||||||
|
|
|
@ -84,7 +84,7 @@ export function addWord(word, render = true, message = true, upload = true) {
|
||||||
word.createdOn = timestamp;
|
word.createdOn = timestamp;
|
||||||
window.currentDictionary.words.push(word);
|
window.currentDictionary.words.push(word);
|
||||||
if (message) {
|
if (message) {
|
||||||
addMessage(`<a href="#${word.wordId}">${word.name}</a> Created Successfully`, 10000);
|
addMessage(`<a href="#${word.wordId}">${word.name}</a> Created Successfully`, 30000);
|
||||||
}
|
}
|
||||||
sortWords(render);
|
sortWords(render);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue