Skip to content

Commit

Permalink
fix bug in applyWebxdcUpdate()
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Sep 1, 2023
1 parent 3c8d9e5 commit 7476db1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion frontend/public/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.0
2.2.1
15 changes: 5 additions & 10 deletions frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,12 @@ export const useStore = create<State>()((set) => ({
set((state) => {
state = { ...state, syncing: false };
if (update.error) {
return {
...state,
error: update.error,
};
state.error = update.error;
return state;
}
let [syncTime, botsData, statusData] = update.result || ["", null, null];
localStorage.setItem(lastSyncKey, syncTime);
state.lastSync = syncTime = new Date(syncTime);
if (statusData) {
state.bots.map((bot: Bot) => {
if (statusData[bot.addr]) {
Expand All @@ -94,13 +93,9 @@ export const useStore = create<State>()((set) => ({
bot.lastSeen = new Date(bot.lastSeen);
}
});
state = {
...state,
hash: botsData.hash,
bots: botsData.bots,
};
state.hash = botsData.hash;
state.bots = botsData.bots;
}
syncTime = new Date(syncTime);
state.bots.sort((b1: Bot, b2: Bot) => {
let online1 = isOnline(syncTime, b1.lastSeen);
let online2 = isOnline(syncTime, b2.lastSeen);
Expand Down

0 comments on commit 7476db1

Please sign in to comment.