client-app/app/controllers/index.js in logster-1.3.4 vs client-app/app/controllers/index.js in logster-1.4.0.pre
- old
+ new
@@ -54,10 +54,23 @@
const messages = this.get("model");
messages.solve(msg);
}
},
+ updateSelectedMessage() {
+ const currentKey = this.get("currentMessage.key");
+ const messages = this.get("model.messages");
+ if (currentKey && messages) {
+ const match = messages.find(m => m.key === currentKey);
+ if (match) {
+ match.set("selected", true);
+ } else {
+ this.set("currentMessage", null);
+ }
+ }
+ },
+
filterChanged: observer(
"showDebug",
"showInfo",
"showWarn",
"showErr",
@@ -73,20 +86,20 @@
// always show unknown, rare
filter.push(5);
const model = this.get("model");
model.set("filter", filter);
if (this.get("initialized")) {
- model.reload();
+ model.reload().then(() => this.updateSelectedMessage());
}
}
),
searchChanged: observer("search", function() {
const search = this.get("search");
const model = this.get("model");
model.set("search", search);
if (this.get("initialized")) {
- model.reload();
+ model.reload().then(() => this.updateSelectedMessage());
}
})
});