Optimized subscriptions
This commit is contained in:
@@ -9,5 +9,5 @@
|
||||
|
||||
|
||||
#bucket_image {
|
||||
width: 30%;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
8
app/client/startup.js
Normal file
8
app/client/startup.js
Normal file
@@ -0,0 +1,8 @@
|
||||
Tracker.autorun(function () {
|
||||
var id = Session.get('controller_id');
|
||||
if (id) {
|
||||
Meteor.subscribe("sensor_data", id);
|
||||
var hamo = Meteor.subscribe("controller_state", id);
|
||||
console.log(hamo);
|
||||
}
|
||||
});
|
||||
@@ -1,12 +1,7 @@
|
||||
function controller_state() {
|
||||
var controller = Session.get('controller_id');
|
||||
var result = {}
|
||||
if (controller) {
|
||||
result = ControllerState.findOne({
|
||||
controller_id: controller
|
||||
});
|
||||
}
|
||||
|
||||
var controllerId = Session.get('controller_id');
|
||||
result = ControllerState.findOne({});
|
||||
console.log("jupiii", result);
|
||||
if (!result) {
|
||||
result = {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user