Skip to content

Commit

Permalink
feat: remove unused addChatID and fix preload startup detection (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
fznhq authored Aug 5, 2022
1 parent 4efbea2 commit ad54876
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
18 changes: 2 additions & 16 deletions src/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,13 @@ window.onload = () => {

new MutationObserver((mutations) => {
// Check when WhatsApp is done loading
if (
mutations[0].removedNodes.length > 0 &&
mutations[0].removedNodes[0].id === "startup"
) {
addChatIDs();

// Update chat IDs when a chat is added/removed.
new MutationObserver(() => {
addChatIDs();
}).observe(
document.querySelector('#pane-side [role="region"]', {
subtree: true,
childList: true,
})
);

if (mutations[0].removedNodes[0]?.innerHTML.includes("progress")) {
// Remove "Update available" message
if (
document.querySelector("._3z9_h").innerText.includes("Update available")
) {
document.querySelector("._3z9_h").style.display = "none";
document.querySelector("._3z9_h").firstChild.remove()
}
}

Expand Down
16 changes: 0 additions & 16 deletions src/util/webview/addChatIDs.js

This file was deleted.

0 comments on commit ad54876

Please sign in to comment.