change logs aswell (#21)

* kurt-19-change-logs-aswell

* fix tests
This commit is contained in:
Kurt Hutten
2023-02-03 11:09:09 +11:00
committed by GitHub
parent 487d61b862
commit 9bb4f68794
5 changed files with 38 additions and 28 deletions

View File

@ -113,7 +113,12 @@ export const useStore = create<StoreState>()((set, get) => ({
},
logs: [],
addLog: (log) => {
set((state) => ({ logs: [...state.logs, log] }))
if (Array.isArray(log)) {
const cleanLog: any = log.map(({ __geoMeta, ...rest }) => rest)
set((state) => ({ logs: [...state.logs, cleanLog] }))
} else {
set((state) => ({ logs: [...state.logs, log] }))
}
},
resetLogs: () => {
set({ logs: [] })