diff options
author | eperelm2 <emily_perelman@brown.edu> | 2023-08-24 20:54:45 +0200 |
---|---|---|
committer | eperelm2 <emily_perelman@brown.edu> | 2023-08-24 20:54:45 +0200 |
commit | f189b4f65163a7bc231b5aa57f01d915f953931d (patch) | |
tree | b8bd6fba593a29319972a40a07f572063b300b25 /src/client/util/PingManager.ts | |
parent | 2fcad5e8bd1412487b4fcacefdc12a2df5707638 (diff) | |
parent | 372face940712d239d48f9884ded34d82d170a94 (diff) |
filter - made small finishing changes
Diffstat (limited to 'src/client/util/PingManager.ts')
-rw-r--r-- | src/client/util/PingManager.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/util/PingManager.ts b/src/client/util/PingManager.ts index 0c41a1ea7..4dd2fcd35 100644 --- a/src/client/util/PingManager.ts +++ b/src/client/util/PingManager.ts @@ -1,5 +1,6 @@ -import { action, observable } from 'mobx'; +import { action, observable, runInAction } from 'mobx'; import { Networking } from '../Network'; +import { CurrentUserUtils } from './CurrentUserUtils'; export class PingManager { // create static instance and getter for global use @observable static _instance: PingManager; @@ -18,7 +19,8 @@ export class PingManager { }; sendPing = async (): Promise<void> => { try { - await Networking.PostToServer('/ping', { date: new Date() }); + const res = await Networking.PostToServer('/ping', { date: new Date() }); + runInAction(() => (CurrentUserUtils.ServerVersion = res.message)); !this.IsBeating && this.setIsBeating(true); } catch { if (this.IsBeating) { |