From ad2287621929109dd58a46308fc640496e631be3 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 31 Aug 2022 22:25:40 -0700 Subject: [PATCH] Device paging refresh fix. --- views/default-mobile.handlebars | 8 ++++---- views/default.handlebars | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index caa85c92..1f1d9e18 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -1373,7 +1373,7 @@ // Fetch list of meshes, nodes, files meshserver.send({ action: 'usergroups' }); meshserver.send({ action: 'meshes' }); - meshserver.send({ action: 'nodes' }); + meshserver.send({ action: 'nodes', skip: (devicePagingState == null) ? 0 : devicePagingState.skip }); meshserver.send({ action: 'files' }); authCookieRenewTimer = setInterval(function () { meshserver.send({ action: 'authcookie' }); }, 1800000); // Request a cookie refresh every 30 minutes. } @@ -1776,7 +1776,7 @@ updateSelf(); // If our list of nodes may have changes, request the new list now. - if (message.event.nodeListChange == userinfo._id) { meshserver.send({ action: 'nodes' }); } + if (message.event.nodeListChange == userinfo._id) { meshserver.send({ action: 'nodes', skip: (devicePagingState == null) ? 0 : devicePagingState.skip }); } } break; } @@ -1799,7 +1799,7 @@ // Group update, refresh all our device groups and nodes. TODO: Optimize this to only do this when needed. meshserver.send({ action: 'meshes' }); - meshserver.send({ action: 'nodes' }); + meshserver.send({ action: 'nodes', skip: (devicePagingState == null) ? 0 : devicePagingState.skip }); break; } case 'deleteusergroup': { @@ -1834,7 +1834,7 @@ // This is a new mesh for us if (add) { meshes[message.event.meshid] = { _id: message.event.meshid, name: message.event.name, mtype: message.event.mtype, desc: message.event.desc, links: message.event.links, relayid: message.event.relayid }; - meshserver.send({ action: 'nodes' }); // Request a refresh of all nodes (TODO: We could optimize this to only request nodes for the new mesh). + meshserver.send({ action: 'nodes', skip: (devicePagingState == null) ? 0 : devicePagingState.skip }); // Request a refresh of all nodes (TODO: We could optimize this to only request nodes for the new mesh). } } else { // This is an existing mesh diff --git a/views/default.handlebars b/views/default.handlebars index 3d1d12da..21c0e8fa 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2099,7 +2099,7 @@ // Fetch list of meshes, nodes, files meshserver.send({ action: 'usergroups' }); meshserver.send({ action: 'meshes' }); - meshserver.send({ action: 'nodes', id: '{{currentNode}}' }); + meshserver.send({ action: 'nodes', id: '{{currentNode}}', skip: (devicePagingState == null) ? 0 : devicePagingState.skip }); meshserver.send({ action: 'loginTokens' }); if (pluginHandler != null) { meshserver.send({ action: 'plugins' }); } if ('{{currentNode}}'.toLowerCase() == '') { meshserver.send({ action: 'files' }); } @@ -3104,7 +3104,7 @@ } // If our list of nodes may have changes, request the new list now. - if (message.event.nodeListChange == userinfo._id) { meshserver.send({ action: 'nodes' }); } + if (message.event.nodeListChange == userinfo._id) { meshserver.send({ action: 'nodes', skip: (devicePagingState == null) ? 0 : devicePagingState.skip }); } } if (currentNode) { refreshDevice(currentNode._id); } if (users == null) break; @@ -3146,7 +3146,7 @@ // Group update, refresh all our device groups and nodes. TODO: Optimize this to only do this when needed. meshserver.send({ action: 'meshes' }); - meshserver.send({ action: 'nodes' }); + meshserver.send({ action: 'nodes', skip: (devicePagingState == null) ? 0 : devicePagingState.skip }); break; } case 'deleteusergroup': { @@ -3181,7 +3181,7 @@ // This is a new mesh for us if (add) { meshes[message.event.meshid] = { _id: message.event.meshid, name: message.event.name, mtype: message.event.mtype, desc: message.event.desc, links: message.event.links, amt: message.event.amt, invite: message.event.invite, expireDevs: message.event.expireDevs, relayid: message.event.relayid }; - meshserver.send({ action: 'nodes' }); // Request a refresh of all nodes (TODO: We could optimize this to only request nodes for the new mesh). + meshserver.send({ action: 'nodes', skip: (devicePagingState == null) ? 0 : devicePagingState.skip }); // Request a refresh of all nodes (TODO: We could optimize this to only request nodes for the new mesh). } } else { // This is an existing device group