Make some messages appear longer/permanently

This commit is contained in:
Robbie Antenesse 2019-05-24 11:45:08 -06:00
parent d3ef16b947
commit d228d1194a
3 changed files with 7 additions and 5 deletions

View File

@ -37,7 +37,7 @@ export function logIn() {
const loginModal = document.getElementById('loginModal');
loginModal.parentElement.removeChild(loginModal);
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();
}
}).catch(err => console.error(err));
@ -106,7 +106,7 @@ export function createAccount() {
loginModal.parentElement.removeChild(loginModal);
triggerLoginChanges();
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')) {
// Ensure dictionary uploads to overwrite the auto-created default dictionary
delete window.currentDictionary.externalID;
@ -125,7 +125,7 @@ export function validateToken() {
}, userData => {
window.account = userData;
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();
}, error => {
addMessage(error + '. Logging Out.', undefined, 'error');

View File

@ -149,7 +149,9 @@ export function addMessage(messageText, time = 5000, extraClass = false) {
};
closeButton.addEventListener('click', closeMessage);
setTimeout(closeMessage, time);
if (time > 0) {
setTimeout(closeMessage, time);
}
}
export function hideAllModals() {

View File

@ -84,7 +84,7 @@ export function addWord(word, render = true, message = true, upload = true) {
word.createdOn = timestamp;
window.currentDictionary.words.push(word);
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);