Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Inbox icon indicator is buggy #23

Closed
Raymo111 opened this issue Oct 20, 2021 · 4 comments
Closed

BUG: Inbox icon indicator is buggy #23

Raymo111 opened this issue Oct 20, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Raymo111
Copy link

The keyword matches icon/button that opens the inbox is sometimes red (shown) when there are no items in the inbox, and sometimes it is not shown when there are unread items in the inbox.

@sarahkittyy sarahkittyy self-assigned this Oct 20, 2021
@sarahkittyy sarahkittyy added the bug Something isn't working label Oct 20, 2021
@sarahkittyy
Copy link
Owner

I already know about this, I actually didn't implement any sort of little "unread" indicator at all, it seems that the way I put the button there just. breaks discord :)
I'll fix it Eventually:tm:

@Raymo111
Copy link
Author

Ok, thanks!

@andylizi
Copy link

This is simply because the "Keyword Matches" button is cloned from the "Pinned Message" button, and if that button happens to have the unread indicator at that time, it would also be included.

let pinned = document.querySelector('div[class*="toolbar-3" i] > div:first-child');
if (!pinned) {
return;
}
const ModalCloseEvent = new Event('modalclose');
let inbox = pinned.cloneNode(true);
inbox.setAttribute('is-keyword-tracker-inbox', true);
inbox.setAttribute('aria-label', 'Keyword Matches');

To fix it, just add this line:

       let inbox = pinned.cloneNode(true);
+      inbox.querySelector('span')?.remove();
       inbox.setAttribute('is-keyword-tracker-inbox', true);
       inbox.setAttribute('aria-label', 'Keyword Matches');

@sarahkittyy
Copy link
Owner

Added in 3a40033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants