diff --git a/meshuser.js b/meshuser.js index 6244ea52..fd4f81be 100644 --- a/meshuser.js +++ b/meshuser.js @@ -2600,7 +2600,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (change != '') { db.Set(mesh); - var event = { etype: 'mesh', userid: user._id, username: user.name, meshid: mesh._id, name: mesh.name, mtype: mesh.mtype, desc: mesh.desc, flags: mesh.flags, consent: mesh.consent, action: 'meshchange', links: mesh.links, msg: change, domain: domain.id, invite: mesh.invite, expireDevs: mesh.expireDevs }; + var event = { etype: 'mesh', userid: user._id, username: user.name, meshid: mesh._id, name: mesh.name, mtype: mesh.mtype, desc: mesh.desc, flags: mesh.flags, consent: mesh.consent, action: 'meshchange', links: mesh.links, msg: change, domain: domain.id, invite: mesh.invite, expireDevs: command.expireDevs }; if (db.changeStream) { event.noact = 1; } // If DB change stream is active, don't use this event to change the mesh. Another event will come. parent.parent.DispatchEvent(parent.CreateMeshDispatchTargets(mesh, [user._id]), obj, event); } diff --git a/views/default.handlebars b/views/default.handlebars index 1df94c68..3dff343b 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2912,7 +2912,7 @@ if (message.event.links) { meshes[message.event.meshid].links = message.event.links; } if (message.event.amt) { meshes[message.event.meshid].amt = message.event.amt; } if (message.event.invite != null) { meshes[message.event.meshid].invite = message.event.invite; } else { delete meshes[message.event.meshid].invite; } - if (message.event.expireDevs != null) { meshes[message.event.meshid].expireDevs = message.event.expireDevs; } else { delete meshes[message.event.meshid].expireDevs; } + if (message.event.expireDevs != null) { if (message.event.expireDevs > 0) { meshes[message.event.meshid].expireDevs = message.event.expireDevs; } else { delete meshes[message.event.meshid].expireDevs; } } // Check if we lost rights to this mesh in this change. if (IsMeshViewable(message.event.meshid) == false) {