[Glitch] Fix WebUI crash when loading account data before page is loaded

This commit is contained in:
Thibaut Girka 2020-06-09 11:55:07 +02:00
parent b826e504b4
commit e9d7ca7645

View file

@ -11,7 +11,7 @@ const darkEmoji = '🎱🐜⚫🖤⬛◼️◾◼️✒️▪️💣🎳📷📸
const lightEmoji = '👽⚾🐔☁️💨🕊️👀🍥👻🐐❕❔⛸️🌩️🔊🔇📃🌧️🐏🍚🍙🐓🐑💀☠️🌨️🔉🔈💬💭🏐🏳️⚪⬜◽◻️▫️'; const lightEmoji = '👽⚾🐔☁️💨🕊️👀🍥👻🐐❕❔⛸️🌩️🔊🔇📃🌧️🐏🍚🍙🐓🐑💀☠️🌨️🔉🔈💬💭🏐🏳️⚪⬜◽◻️▫️';
const emojiFilename = (filename, match) => { const emojiFilename = (filename, match) => {
const borderedEmoji = document.body.classList.contains('skin-mastodon-light') ? lightEmoji : darkEmoji; const borderedEmoji = (document.body && document.body.classList.contains('skin-mastodon-light')) ? lightEmoji : darkEmoji;
return borderedEmoji.includes(match) ? (filename + '_border') : filename; return borderedEmoji.includes(match) ? (filename + '_border') : filename;
}; };