Move the default protocols into hanging protocol strategy not to add the default protocols of the default strategy when another strategy is used
This commit is contained in:
parent
fa4edaba7c
commit
99d5c01dab
@ -5,6 +5,17 @@ var defaultStrategy = (function () {
|
|||||||
|
|
||||||
var hangingProtocolSubs;
|
var hangingProtocolSubs;
|
||||||
|
|
||||||
|
function addDefaultProtocols() {
|
||||||
|
console.log('Inserting default protocols');
|
||||||
|
|
||||||
|
addProtocol(HP.defaultProtocol);
|
||||||
|
|
||||||
|
//addProtocol(HP.testProtocol);
|
||||||
|
HP.demoProtocols.forEach(protocol => {
|
||||||
|
addProtocol(protocol);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getDatabaseIdByProtocolId(protocolId) {
|
function getDatabaseIdByProtocolId(protocolId) {
|
||||||
const filteredProtocol = HangingProtocols.findOne({
|
const filteredProtocol = HangingProtocols.findOne({
|
||||||
id: protocolId
|
id: protocolId
|
||||||
@ -39,6 +50,7 @@ var defaultStrategy = (function () {
|
|||||||
Tracker.autorun((computation) => {
|
Tracker.autorun((computation) => {
|
||||||
if (hangingProtocolSubs.ready()) {
|
if (hangingProtocolSubs.ready()) {
|
||||||
computation.stop();
|
computation.stop();
|
||||||
|
addDefaultProtocols();
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -145,14 +157,4 @@ var defaultStrategy = (function () {
|
|||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
Meteor.startup(() => {
|
|
||||||
HP.ProtocolStore.setStrategy(defaultStrategy);
|
HP.ProtocolStore.setStrategy(defaultStrategy);
|
||||||
HP.ProtocolStore.onReady(() => {
|
|
||||||
console.log('Inserting default protocols');
|
|
||||||
HP.ProtocolStore.addProtocol(HP.defaultProtocol);
|
|
||||||
//HP.ProtocolStore.addProtocol(HP.testProtocol);
|
|
||||||
HP.demoProtocols.forEach(protocol => {
|
|
||||||
HP.ProtocolStore.addProtocol(protocol);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Loading…
Reference in New Issue
Block a user