Only show `alert` once when TOS changes
parent
d90c29af8a
commit
6e2b64b39c
|
@ -26,6 +26,7 @@ export function responseFulfilled(input: AxiosResponse): AxiosResponse {
|
|||
return input;
|
||||
}
|
||||
|
||||
let ONLY_ONCE = true;
|
||||
export function responseRejected(x: SafeError | undefined) {
|
||||
if (x && isSafeError(x)) {
|
||||
dispatchNetworkUp("user.api");
|
||||
|
@ -50,7 +51,8 @@ export function responseRejected(x: SafeError | undefined) {
|
|||
break;
|
||||
case 451:
|
||||
// DONT REFACTOR: I want to use alert() because it's blocking.
|
||||
alert(t(Content.TOS_UPDATE));
|
||||
ONLY_ONCE && alert(t(Content.TOS_UPDATE));
|
||||
ONLY_ONCE = false;
|
||||
window.location.href = "/tos_update";
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue