Skip to content

Commit

Permalink
fix: offline banner sometimes not being hidden when coming back online
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Nov 4, 2024
1 parent 2736500 commit d448af8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/ts/states/connection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { throttle } from "throttle-debounce";
import { debounce } from "throttle-debounce";
import * as Notifications from "../elements/notifications";
import * as ConnectionEvent from "../observables/connection-event";
import * as TestState from "../test/test-state";
Expand Down Expand Up @@ -29,12 +29,12 @@ export function showOfflineBanner(): void {
}
}

const throttledHandleState = throttle(10000, () => {
const throttledHandleState = debounce(5000, () => {
if (state) {
Notifications.add("You're back online", 1, {
customTitle: "Connection",
});
if (noInternetBannerId !== undefined) {
Notifications.add("You're back online", 1, {
customTitle: "Connection",
});
$(
`#bannerCenter .banner[id="${noInternetBannerId}"] .closeButton`
).trigger("click");
Expand Down

0 comments on commit d448af8

Please sign in to comment.