fix(servers): Fix subscription issue for production deployment. Added clientOnly option for static site deployments of OHIF Viewer

This commit is contained in:
Erik Ziegler 2018-09-21 15:16:28 +02:00
parent 18bcf83805
commit c4b1086097
2 changed files with 5 additions and 5 deletions

View File

@ -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'),

View File

@ -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);
}