aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-05-22 12:57:54 +0200
committerGitHub <noreply@github.com>2020-05-22 11:57:54 +0100
commit6af13dbac2179c8fd2c63bcf175c04a112f8c080 (patch)
treed2d841a89e49062362eaf0c56602eb82519c2b69 /web_src/js
parent88fe7b5a720365e5c8f0a347730f895263465311 (diff)
downloadgitea-6af13dbac2179c8fd2c63bcf175c04a112f8c080.tar.gz
gitea-6af13dbac2179c8fd2c63bcf175c04a112f8c080.zip
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.
Diffstat (limited to 'web_src/js')
-rw-r--r--web_src/js/features/notification.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/web_src/js/features/notification.js b/web_src/js/features/notification.js
index 8b843e9806..0ea7f93c8d 100644
--- a/web_src/js/features/notification.js
+++ b/web_src/js/features/notification.js
@@ -52,6 +52,9 @@ export function initNotificationCount() {
source.close();
window.location.href = AppSubUrl;
});
+ window.addEventListener('beforeunload', () => {
+ source.close();
+ });
return;
}