mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix syncing from note menu
This commit is contained in:
@@ -595,20 +595,23 @@ export const ActionSheetComponent = ({
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (user?.lastSynced < note?.dateEdited) {
|
if (user?.lastSynced < note?.dateEdited || !user.lastSynced) {
|
||||||
setRefreshing(true);
|
setRefreshing(true);
|
||||||
try {
|
try {
|
||||||
let user = await db.user.get();
|
|
||||||
dispatch({type: Actions.USER, user: user});
|
|
||||||
await db.sync();
|
await db.sync();
|
||||||
localRefresh();
|
localRefresh();
|
||||||
ToastEvent.show('Note synced', 'success', 'local');
|
ToastEvent.show('Note synced', 'success', 'local');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ToastEvent.show(e.message, 'error', 'local');
|
ToastEvent.show(e.message, 'error', 'local');
|
||||||
} finally {
|
} finally {
|
||||||
|
let user = await db.user.get();
|
||||||
|
dispatch({type: Actions.USER, user: user});
|
||||||
|
dispatch({type: Actions.ALL});
|
||||||
setRefreshing(false);
|
setRefreshing(false);
|
||||||
}
|
}
|
||||||
dispatch({type: Actions.ALL});
|
|
||||||
|
} else {
|
||||||
|
console.log('here',user?.lastSynced,user?.lastSynced < note?.dateEdited)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user