fix(servers): Fix subscription issue for production deployment. Added clientOnly option for static site deployments of OHIF Viewer
This commit is contained in:
parent
18bcf83805
commit
c4b1086097
@ -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
|
// (see https://docs.ohif.org/standalone-viewer/usage.html) we don't want
|
||||||
// our routes to get stuck while waiting for Pub / Sub.
|
// our routes to get stuck while waiting for Pub / Sub.
|
||||||
//
|
//
|
||||||
// In this case, the developer is required to add Servers and specify
|
// In this case, the developer is required to add Servers and specify
|
||||||
// a CurrentServer with some other approach (e.g. a separate script).
|
// 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() {
|
Router.waitOn(function() {
|
||||||
return [
|
return [
|
||||||
Meteor.subscribe('servers'),
|
Meteor.subscribe('servers'),
|
||||||
|
|||||||
@ -303,9 +303,9 @@ var clientOnlyStrategy = (function () {
|
|||||||
// If we are running a disconnect client similar to the StandaloneViewer
|
// If we are running a disconnect client similar to the StandaloneViewer
|
||||||
// (see https://docs.ohif.org/standalone-viewer/usage.html) we don't want
|
// (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
|
// our HangingProtocol strategy to try to use Meteor methods or Pub / Sub
|
||||||
if (Meteor.status().connected === true) {
|
if (Meteor.settings.public && Meteor.settings.public.clientOnly === true) {
|
||||||
HP.ProtocolStore.setStrategy(defaultStrategy);
|
|
||||||
} else {
|
|
||||||
HP.ProtocolStore.setStrategy(clientOnlyStrategy);
|
HP.ProtocolStore.setStrategy(clientOnlyStrategy);
|
||||||
|
} else {
|
||||||
|
HP.ProtocolStore.setStrategy(defaultStrategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user