From 732dc07ec501d564343696aa09a9acfec7f4d8ec Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Sat, 21 Aug 2021 12:37:26 +0530 Subject: [PATCH] fix: history sync issues and crashes --- helpers/fb/history.ts | 9 ++++++++- newstore/environments.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/helpers/fb/history.ts b/helpers/fb/history.ts index cfc0d9984..6ba217f8d 100644 --- a/helpers/fb/history.ts +++ b/helpers/fb/history.ts @@ -36,7 +36,10 @@ async function writeHistory(entry: any, col: HistoryFBCollections) { if (currentUser$.value == null) throw new Error("User not logged in to sync history") - const hs = entry + const hs = { + ...entry, + updatedOn: new Date(), + } try { await firebase @@ -200,3 +203,7 @@ export function initHistory() { } }) } + +restHistoryStore.dispatches$.subscribe((state) => { + console.log(state) +}) diff --git a/newstore/environments.ts b/newstore/environments.ts index 5945c7816..a172476d4 100644 --- a/newstore/environments.ts +++ b/newstore/environments.ts @@ -1,4 +1,4 @@ -import { isEqual } from "lodash" +import isEqual from "lodash/isEqual" import { combineLatest } from "rxjs" import { distinctUntilChanged, map, pluck } from "rxjs/operators" import DispatchingStore, {