fix: history sync issues and crashes

This commit is contained in:
Andrew Bastin
2021-08-21 12:37:26 +05:30
parent c00c8f249e
commit 732dc07ec5
2 changed files with 9 additions and 2 deletions

View File

@@ -36,7 +36,10 @@ async function writeHistory(entry: any, col: HistoryFBCollections) {
if (currentUser$.value == null) if (currentUser$.value == null)
throw new Error("User not logged in to sync history") throw new Error("User not logged in to sync history")
const hs = entry const hs = {
...entry,
updatedOn: new Date(),
}
try { try {
await firebase await firebase
@@ -200,3 +203,7 @@ export function initHistory() {
} }
}) })
} }
restHistoryStore.dispatches$.subscribe((state) => {
console.log(state)
})

View File

@@ -1,4 +1,4 @@
import { isEqual } from "lodash" import isEqual from "lodash/isEqual"
import { combineLatest } from "rxjs" import { combineLatest } from "rxjs"
import { distinctUntilChanged, map, pluck } from "rxjs/operators" import { distinctUntilChanged, map, pluck } from "rxjs/operators"
import DispatchingStore, { import DispatchingStore, {