Skip to content

Commit ef97441

Browse files
SmileyJamesdelucis
andauthored
fix(debug): Save all state to localStorage, not just G and ctx (#716)
* Save all state to localStorage, not just G and ctx * Don’t store deltalog, _undo & _redo in debug panel Co-authored-by: Chris Swithinbank <[email protected]>
1 parent 0ca1cef commit ef97441

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/client/debug/main/Controls.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
import { parse, stringify } from 'flatted';
77
88
function Save() {
9-
const { G, ctx } = client.getState();
10-
const json = stringify({ G, ctx });
9+
// strip deltalog, _undo, and _redo from state to persist
10+
const { deltalog, _undo, _redo, ...state } = client.getState();
11+
const json = stringify(state);
1112
window.localStorage.setItem('gamestate', json);
1213
}
1314

0 commit comments

Comments
 (0)