1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00

Close EventSource before unloading the page (#11539)

Should eliminate a error in the Firefox console regarding the connection
being interrupted while the page was loading.
This commit is contained in:
silverwind 2020-05-22 12:57:54 +02:00 committed by GitHub
parent 88fe7b5a72
commit 6af13dbac2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,9 @@ export function initNotificationCount() {
source.close();
window.location.href = AppSubUrl;
});
window.addEventListener('beforeunload', () => {
source.close();
});
return;
}