Browse Source

Use function in TabWaiter

j433866 6 năm trước cách đây
mục cha
commit
d99cf9d499
1 tập tin đã thay đổi với 3 bổ sung11 xóa
  1. 3 11
      src/web/waiters/OutputWaiter.mjs

+ 3 - 11
src/web/waiters/OutputWaiter.mjs

@@ -953,11 +953,7 @@ class OutputWaiter {
      * @param {number} inputNum
      */
     async displayTabInfo(inputNum) {
-        const tabItem = this.manager.tabs.getOutputTabItem(inputNum);
-        if (!tabItem) return;
-
-        const tabContent = tabItem.firstElementChild,
-            dish = this.getOutputDish(inputNum);
+        const dish = this.getOutputDish(inputNum);
         let tabStr = "";
 
         if (dish !== null) {
@@ -966,12 +962,8 @@ class OutputWaiter {
         }
 
         tabStr = tabStr.slice(0, 200);
-        if (tabStr === "") {
-            tabStr = `Tab ${inputNum}`;
-        } else {
-            tabStr = `${inputNum}: ${tabStr}`;
-        }
-        tabContent.innerText = tabStr;
+
+        this.manager.tabs.updateOutputTabHeader(inputNum, tabStr);
 
     }