-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
No longer staying on page after marking as read #70
Comments
I'm guessing we can't What do you guys think? @bfred-it @jdreesen Edit: Not sure if it's a good idea but one option is to convert the |
This comment has been minimized.
This comment has been minimized.
But it seems that GitHub no longer loads the notification scripts on the page, so there's no handler at all for the current selector (which should work). From GitHub: o(".js-mark-notification-as-unread", async function(i, e) {
c();
const s = a(i, ".js-notification");
n(s),
f(s, ".js-mark-notification-as-read button");
try {
await e.html()
} catch (o) {
t(s),
r()
}
}), I think it can be replaced with |
So, I did the following:
And it did stop the navigation, but it stopped the actual action as well. Clicking on |
Any progress on this issue please? |
So, instead of letting form I'm passing Here's the snippet of what I tried: const forms = select.all(('.NPG-dropdown form'));
for (const form of forms) {
const action = form.getAttribute('action');
const method = form.getAttribute('method');
form.addEventListener('submit', async () => {
const formData = new FormData();
formData.append('utf8', '✓');
formData.append('authenticity_token', select('input[name="authenticity_token"]', form).value);
// This fails
await fetch(location.origin + action, {
method,
redirect: 'error',
body: new URLSearchParams(formData)
});
updateLoop();
});
form.removeAttribute('action');
} If anyone got a hint or want to try out it's pushed to |
You can use this: https://github.com/sindresorhus/refined-github/blob/master/source/libs/post-form.ts And then something like delegate('buttons', 'click', async event => {
event.preventDefault();
await postForm(event.delegateTarget.form);
button.closest('.unread').classList.replace('unread', 'read')
}); Delegate is https://github.com/fregante/delegate-it |
|
@tanmayrajani is this the old behavior? feels a bit different for me |
@sfdye honestly, I don't remember the old behaviour. It wasn't working since long 😷 Although, if it goes away, you wouldn't have the option to mark as unread/unmuted if you've accidentally clicked on it, right? |
@tanmayrajani Cool, makes sense. Thanks a lot for the fix and release! |
OS: Arch Linux
Browser: Firefox 66.0.1
Notifications Preview for GitHub: 1.5.3
This wonderful time-saver extension seems partly broken (due to recent GitHub changes?). I love previewing notifications
without leaving the page
, but recently I getredirected
to https://github.com/notifications after marking stuff read. Is this something that can be fixed somehow?The text was updated successfully, but these errors were encountered: