Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: history sync issues and crashes

Andrew Bastin732dc07ec501
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, {