Skip to content

Commit d448af8

Browse files
committed
fix: offline banner sometimes not being hidden when coming back online
1 parent 2736500 commit d448af8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

frontend/src/ts/states/connection.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { throttle } from "throttle-debounce";
1+
import { debounce } from "throttle-debounce";
22
import * as Notifications from "../elements/notifications";
33
import * as ConnectionEvent from "../observables/connection-event";
44
import * as TestState from "../test/test-state";
@@ -29,12 +29,12 @@ export function showOfflineBanner(): void {
2929
}
3030
}
3131

32-
const throttledHandleState = throttle(10000, () => {
32+
const throttledHandleState = debounce(5000, () => {
3333
if (state) {
34-
Notifications.add("You're back online", 1, {
35-
customTitle: "Connection",
36-
});
3734
if (noInternetBannerId !== undefined) {
35+
Notifications.add("You're back online", 1, {
36+
customTitle: "Connection",
37+
});
3838
$(
3939
`#bannerCenter .banner[id="${noInternetBannerId}"] .closeButton`
4040
).trigger("click");

0 commit comments

Comments
 (0)