Skip to content

Commit

Permalink
Clean up some code
Browse files Browse the repository at this point in the history
  • Loading branch information
NI committed Dec 15, 2019
1 parent f190cef commit dff3857
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions ui/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,11 @@ export default {
this.tab.tabs[index].indicator.level = "";
}
},
tabWarning(index, msg) {
tabMessage(index, msg, type) {
if (msg.toDismiss) {
if (
this.tab.tabs[index].indicator.message !== msg.text ||
this.tab.tabs[index].indicator.level !== "warning"
this.tab.tabs[index].indicator.level !== type
) {
return;
}
Expand All @@ -548,25 +548,13 @@ export default {
}

this.tab.tabs[index].indicator.message = msg.text;
this.tab.tabs[index].indicator.level = "warning";
this.tab.tabs[index].indicator.level = type;
},
tabWarning(index, msg) {
this.tabMessage(index, msg, "warning");
},
tabInfo(index, msg) {
if (msg.toDismiss) {
if (
this.tab.tabs[index].indicator.message !== msg.text ||
this.tab.tabs[index].indicator.level !== "info"
) {
return;
}

this.tab.tabs[index].indicator.message = "";
this.tab.tabs[index].indicator.level = "";

return;
}

this.tab.tabs[index].indicator.message = msg.text;
this.tab.tabs[index].indicator.level = "info";
this.tabMessage(index, msg, "info");
},
tabUpdated(index) {
this.$emit("tab-updated", this.tab.tabs);
Expand Down

0 comments on commit dff3857

Please sign in to comment.