aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-05-22 20:30:30 +0200
committerGitHub <noreply@github.com>2020-05-22 19:30:30 +0100
commitd131d53cbb84c3710e4f4138487a81a079a19f2b (patch)
tree285ea338fdefc191f8a4e8d6046eaa45cbe90de8
parent2a6e6bf0f1ef21755905ca6e396b251fd55008ff (diff)
downloadgitea-d131d53cbb84c3710e4f4138487a81a079a19f2b.tar.gz
gitea-d131d53cbb84c3710e4f4138487a81a079a19f2b.zip
Close EventSource before unloading the page (#11539) (#11557)
Should eliminate a error in the Firefox console regarding the connection being interrupted while the page was loading.
-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;
}