Skip to content

Commit

Permalink
fix(cloud-sync): set error to null after finish
Browse files Browse the repository at this point in the history
  • Loading branch information
kitce committed Jan 9, 2022
1 parent 5dee57e commit 79d1533
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/helpers/cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const sync = async () => {
await upload(file.id!, json);
const now = Date.now();
dispatch(metaActions.setLastSyncedTime(now));
dispatch(syncActions.setError(null));
} catch (err) {
dispatch(syncActions.setError(err));
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/slices/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const slice = createSlice({
const { payload } = action;
state.loading = payload;
},
setError: (state, action: PayloadAction<unknown>) => {
setError: (state, action: PayloadAction<unknown | null>) => {
const { payload } = action;
state.error = payload;
}
Expand Down

0 comments on commit 79d1533

Please sign in to comment.