From c4b1086097729418d2f4d4ff5cdb149a370f459a Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Fri, 21 Sep 2018 15:16:28 +0200 Subject: [PATCH] fix(servers): Fix subscription issue for production deployment. Added clientOnly option for static site deployments of OHIF Viewer --- OHIFViewer/client/routes.js | 4 ++-- .../client/protocolStore/defaultStrategy.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OHIFViewer/client/routes.js b/OHIFViewer/client/routes.js index a381401da..f8e3b0d0b 100644 --- a/OHIFViewer/client/routes.js +++ b/OHIFViewer/client/routes.js @@ -6,13 +6,13 @@ Router.configure({ }); -// If we are running a disconnect client similar to the StandaloneViewer +// If we are running a disconnected client similar to the StandaloneViewer // (see https://docs.ohif.org/standalone-viewer/usage.html) we don't want // our routes to get stuck while waiting for Pub / Sub. // // In this case, the developer is required to add Servers and specify // a CurrentServer with some other approach (e.g. a separate script). -if (Meteor.status().connected === true) { +if (Meteor.settings.public && Meteor.settings.public.clientOnly !== true) { Router.waitOn(function() { return [ Meteor.subscribe('servers'), diff --git a/Packages/ohif-hanging-protocols/client/protocolStore/defaultStrategy.js b/Packages/ohif-hanging-protocols/client/protocolStore/defaultStrategy.js index 761ae183b..c3684af7b 100644 --- a/Packages/ohif-hanging-protocols/client/protocolStore/defaultStrategy.js +++ b/Packages/ohif-hanging-protocols/client/protocolStore/defaultStrategy.js @@ -303,9 +303,9 @@ var clientOnlyStrategy = (function () { // If we are running a disconnect client similar to the StandaloneViewer // (see https://docs.ohif.org/standalone-viewer/usage.html) we don't want // our HangingProtocol strategy to try to use Meteor methods or Pub / Sub -if (Meteor.status().connected === true) { - HP.ProtocolStore.setStrategy(defaultStrategy); -} else { +if (Meteor.settings.public && Meteor.settings.public.clientOnly === true) { HP.ProtocolStore.setStrategy(clientOnlyStrategy); +} else { + HP.ProtocolStore.setStrategy(defaultStrategy); }