Skip to content

Commit

Permalink
fix: fix cloud sync timestamp when logging in
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcl-io committed Apr 15, 2021
1 parent 40da5d4 commit 4f83502
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useCloudSyncLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import saveFileCollectionFromBase64 from '../services/saveFileCollectionFromBase
import { useStoreActions } from '../store/typedHooks';
import loadUserFromDisk from '../services/loadUserFromDisk';
import syncAccountAndNotesToCloudSync from '../services/syncAccountAndNotesToCloudSync';
import moment from 'moment';

type LoginPayload = {
username: string;
Expand Down Expand Up @@ -98,7 +99,9 @@ const useCloudSyncLogin = (): {
return;
}

setUser(loadUser.user);
const user = { ...loadUser.user, cloudLastSynced: moment().unix() };

setUser(user);
setPasswordKey(loadUser.passwordKey);
setCloudSyncPasswordKey(loadUser.cloudSyncPasswordKey);
setFileCollection(loadUser.fileCollection);
Expand Down

0 comments on commit 4f83502

Please sign in to comment.