Make JS function existence check more verbose

Apparently, the short version does not always work for some reason. I cannot make sense of it, so I'm changing it to this.
This commit is contained in:
Tetrakern 2024-08-19 14:31:15 +02:00
parent 3120cf6f5a
commit 68f0a38cbc
3 changed files with 20 additions and 9 deletions

File diff suppressed because one or more lines are too long

8
js/complete.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -331,7 +331,10 @@ fcn_theBody.addEventListener('click', e => {
)
) {
fcn_toggleLastClicked?.(lastClickTarget);
fcn_popupPosition?.();
if (typeof fcn_popupPosition === 'function') {
fcn_popupPosition();
}
e.stopPropagation();
return;
@ -1407,9 +1410,17 @@ const /** @const {MutationObserver} */ fcn_cardListMutationObserver = new Mutati
mutations.forEach(mutation => {
if (mutation.addedNodes.length > 0) {
// Update view
fcn_updateFollowsView?.();
fcn_updateCheckmarksView?.();
fcn_updateRemindersView?.();
if (typeof fcn_updateFollowsView === 'function') {
fcn_updateFollowsView();
}
if (typeof fcn_updateCheckmarksView === 'function') {
fcn_updateCheckmarksView();
}
if (typeof fcn_updateRemindersView === 'function') {
fcn_updateRemindersView();
}
}
});
});