Bugfix/#115 console error in chronicle tab #117

Merged
Serraniel merged 2 commits from bugfix/#115-console-error-in-chronicle-tab into develop 2020-11-15 20:05:44 +01:00
4 changed files with 6 additions and 7 deletions

View file

@ -23,7 +23,7 @@ function observeScreenshotTooltip(tooltip) {
// Switched to invisible // Switched to invisible
if (!mutation.oldValue.includes('display: none') && mutation.target.style.display == 'none') { if (!mutation.oldValue.includes('display: none') && mutation.target.style.display == 'none') {
let player = findPlayer(); let player = findPlayer();
if (typeof player !== 'undefined') { if (helper.assigned(player)) {
resumePlayer(player); resumePlayer(player);
} }
} }

View file

@ -31,8 +31,7 @@ function updateLanguageDisplay(node) {
function updateLanguageDisplayListMode(node) { function updateLanguageDisplayListMode(node) {
// last column with flags // last column with flags
let col = node.querySelector('h3.layout-align-end-center'); let col = node.querySelector('h3.layout-align-end-center');
if (!helper.assigned(col) || col.awpManipulated) {
if (typeof col === 'undefined' || col.awpManipulated) {
return; return;
} }
@ -43,7 +42,7 @@ function updateLanguageDisplayBoxMode(node) {
// last column with flags // last column with flags
let col = node.querySelector('div.layout-align-end-start'); let col = node.querySelector('div.layout-align-end-start');
if (typeof col === 'undefined' || col.awpManipulated) { if (!helper.assigned(col) || col.awpManipulated) {
return; return;
} }

View file

@ -1,6 +1,7 @@
import * as core from '../utils/aniwatchCore'; import * as core from '../utils/aniwatchCore';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { getGlobalConfiguration, SETTINGS_w2gDisplayCharacterCounter } from '../configuration/configuration'; import { getGlobalConfiguration, SETTINGS_w2gDisplayCharacterCounter } from '../configuration/configuration';
import { assigned } from '../utils/helpers';
export function init() { export function init() {
getGlobalConfiguration().getProperty(SETTINGS_w2gDisplayCharacterCounter, value => { getGlobalConfiguration().getProperty(SETTINGS_w2gDisplayCharacterCounter, value => {
@ -16,7 +17,7 @@ function manipulateChatInput() {
let textarea = document.querySelector('.chat-input textarea'); let textarea = document.querySelector('.chat-input textarea');
// avoid duplicate registration // avoid duplicate registration
if (typeof textarea.dataset.charCounterId !== 'undefined') { if (assigned(textarea.dataset.charCounterId)) {
return; return;
} }
@ -40,7 +41,6 @@ function addCharCounter(textarea) {
updateCharCounter(textarea, charCounterSpan); updateCharCounter(textarea, charCounterSpan);
textarea.addEventListener('keyup', () => { textarea.addEventListener('keyup', () => {
console.log('TRIGGER')
updateCharCounter(textarea, charCounterSpan) updateCharCounter(textarea, charCounterSpan)
}); });
} }

View file

@ -82,7 +82,7 @@ function awaitPageLoaded() {
}); });
}; };
if (typeof preLoader === 'undefined') { if (!helper.assigned(preLoader)) {
runScripts(); runScripts();
return; return;
} }