Skip to content
Snippets Groups Projects
Unverified Commit 6019d538 authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

Regression: Fix undefined presence after reconnect (#16477)

parent 95a63b75
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -37,6 +37,9 @@ Meteor.startup(function() {
if (!uid) {
return;
}
if (!Meteor.status().connected) {
return;
}
const user = await syncUserdata(uid);
if (!user) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment