Skip to content

Commit

Permalink
ts error + node ver consistency .github
Browse files Browse the repository at this point in the history
  • Loading branch information
jackschedel committed Nov 15, 2024
1 parent 5701c99 commit 9d26a69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js 18
- name: Use Node.js 22
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 22

- name: Install dependencies
run: pnpm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
id: packageJson
run: echo "PACKAGE_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV

- name: Use Node.js 18
- name: Use Node.js 22
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 22

- name: Get pnpm cache directory path
id: pnpm-cache-dir-path
Expand Down
6 changes: 5 additions & 1 deletion src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const useStore = create<StoreState>()(
partialize: (state) => createPartializedState(state),
version: 9,
migrate: (persistedState, version) => {
let state = persistedState as StoreState;

Check failure

Code scanning / ESLint

require `const` declarations for variables that are never reassigned after declared Error

'state' is never reassigned. Use 'const' instead.
switch (version) {
case 0:
migrateV0(persistedState as LocalStorageInterfaceV0ToV1);
Expand Down Expand Up @@ -110,7 +111,10 @@ const useStore = create<StoreState>()(
migrateV8(persistedState as LocalStorageInterfaceV8ToV9);
break;
}
return persistedState as StoreState;
return {
...createPartializedState({} as StoreState),
...state,
};
},
}
)
Expand Down

0 comments on commit 9d26a69

Please sign in to comment.