Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/lib/userData.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const isSyncReady = new ReactiveVar(false);

function updateUser(userData) {
const user = Users.findOne({ _id: userData._id });
if (!user || userData._updatedAt > user._updatedAt) {
if (!user || userData._updatedAt > user._updatedAt.toISOString()) {
userData._updatedAt = new Date(userData._updatedAt);
return Meteor.users.upsert({ _id: userData._id }, userData);
}
// delete data already on user's collection as those are newer
Expand Down
3 changes: 3 additions & 0 deletions client/startup/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Meteor.startup(function() {
if (!uid) {
return;
}
if (!Meteor.status().connected) {
return;
}

const user = await syncUserdata(uid);
if (!user) {
Expand Down