From 55a1574f461971e2ce08aa0a89a28f76396e9090 Mon Sep 17 00:00:00 2001 From: NI Date: Tue, 1 Oct 2019 15:46:18 +0800 Subject: [PATCH] Adjust `document.title` Update indicator. --- ui/app.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ui/app.js b/ui/app.js index 776a22c..71175d3 100644 --- a/ui/app.js +++ b/ui/app.js @@ -306,14 +306,15 @@ function startApp(rootEl) { this.changeTitleInfo("(" + tabs.length + (updated ? "*" : "") + ")"); }, tabOpened(tabs) { - if (this.tabUpdateIndicator) { - clearTimeout(this.tabUpdateIndicator); - this.tabUpdateIndicator = null; - } - - this.updateTabTitleInfo(tabs, false); + this.tabUpdated(tabs); }, tabClosed(tabs) { + if (tabs.length > 0) { + this.updateTabTitleInfo(tabs, this.tabUpdateIndicator !== null); + + return; + } + if (this.tabUpdateIndicator) { clearTimeout(this.tabUpdateIndicator); this.tabUpdateIndicator = null; @@ -330,6 +331,7 @@ function startApp(rootEl) { this.updateTabTitleInfo(tabs, true); this.tabUpdateIndicator = setTimeout(() => { + this.tabUpdateIndicator = null; this.updateTabTitleInfo(tabs, false); }, updateIndicatorMaxDisplayTime); }