diff --git a/android/app/src/main/assets/public/main.js b/android/app/src/main/assets/public/main.js index 19223816..5af85a61 100644 --- a/android/app/src/main/assets/public/main.js +++ b/android/app/src/main/assets/public/main.js @@ -834,10 +834,12 @@ async function initBlahs() { try { //try user lang first res = await fetchAsync(`${path}blah/${lang}.json`); + blah = JSON.parse(res); } catch (e) { //fallback to en-us res = await fetchAsync(`${path}blah/en-us.json`); + blah = JSON.parse(res); } - blah = JSON.parse(res); + let blahTags = document.getElementsByTagName("blah"); for (let i = 0; i < blahTags.length; i++) { @@ -2403,6 +2405,7 @@ function handleMessageContextMenu(e, msgId) { async function deleteMessage(msgId) { if (fixedContextMenu) fixedContextMenu.classList.remove("show"); + if (typeof clearContextMenuStyles === "function") clearContextMenuStyles(); showAction("action.message.deleting", "msgdel"); try { let msgPayload = { @@ -2439,7 +2442,7 @@ async function scrollToMessage(msgId) { }, 1500); } else { if (oldestLoadedMsgId !== null && parseInt(msgId) < oldestLoadedMsgId) { - showAction("info.sending.message", "msgscroll"); + showAction("info.messages.loading.older", "msgscroll"); let tries = 0; while (!document.getElementById(`msg-${msgId}`) && oldestLoadedMsgId > 0 && tries < 15) { await loadDmMessages(currentDmId, (oldestLoadedMsgId - 1).toString(), true); @@ -2464,6 +2467,7 @@ async function scrollToMessage(msgId) { async function replyMessage(msgId) { if (fixedContextMenu) fixedContextMenu.classList.remove("show"); + if (typeof clearContextMenuStyles === "function") clearContextMenuStyles(); let msg = loadedMessages[msgId]; if (msg && msg.author) { @@ -2501,6 +2505,7 @@ async function replyMessage(msgId) { async function reactMessagePrompt(msgId, quickReaction = null) { if (fixedContextMenu) fixedContextMenu.classList.remove("show"); + if (typeof clearContextMenuStyles === "function") clearContextMenuStyles(); let reaction = quickReaction; if (!reaction) { reaction = prompt("Enter reaction (emoji or text):"); diff --git a/webroot/main.js b/webroot/main.js index 19223816..5af85a61 100644 --- a/webroot/main.js +++ b/webroot/main.js @@ -834,10 +834,12 @@ async function initBlahs() { try { //try user lang first res = await fetchAsync(`${path}blah/${lang}.json`); + blah = JSON.parse(res); } catch (e) { //fallback to en-us res = await fetchAsync(`${path}blah/en-us.json`); + blah = JSON.parse(res); } - blah = JSON.parse(res); + let blahTags = document.getElementsByTagName("blah"); for (let i = 0; i < blahTags.length; i++) { @@ -2403,6 +2405,7 @@ function handleMessageContextMenu(e, msgId) { async function deleteMessage(msgId) { if (fixedContextMenu) fixedContextMenu.classList.remove("show"); + if (typeof clearContextMenuStyles === "function") clearContextMenuStyles(); showAction("action.message.deleting", "msgdel"); try { let msgPayload = { @@ -2439,7 +2442,7 @@ async function scrollToMessage(msgId) { }, 1500); } else { if (oldestLoadedMsgId !== null && parseInt(msgId) < oldestLoadedMsgId) { - showAction("info.sending.message", "msgscroll"); + showAction("info.messages.loading.older", "msgscroll"); let tries = 0; while (!document.getElementById(`msg-${msgId}`) && oldestLoadedMsgId > 0 && tries < 15) { await loadDmMessages(currentDmId, (oldestLoadedMsgId - 1).toString(), true); @@ -2464,6 +2467,7 @@ async function scrollToMessage(msgId) { async function replyMessage(msgId) { if (fixedContextMenu) fixedContextMenu.classList.remove("show"); + if (typeof clearContextMenuStyles === "function") clearContextMenuStyles(); let msg = loadedMessages[msgId]; if (msg && msg.author) { @@ -2501,6 +2505,7 @@ async function replyMessage(msgId) { async function reactMessagePrompt(msgId, quickReaction = null) { if (fixedContextMenu) fixedContextMenu.classList.remove("show"); + if (typeof clearContextMenuStyles === "function") clearContextMenuStyles(); let reaction = quickReaction; if (!reaction) { reaction = prompt("Enter reaction (emoji or text):");