mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-06 13:40:16 +08:00
fix: offline banner sometimes not being hidden when coming back online
This commit is contained in:
parent
2736500310
commit
d448af8d6f
1 changed files with 5 additions and 5 deletions
|
@ -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";
|
||||
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue