From 5221ac1459b83bf69f6aed847bc9467c2c5497fc Mon Sep 17 00:00:00 2001 From: Razvan Stoenescu Date: Fri, 30 Sep 2022 20:59:59 +0300 Subject: [PATCH] chore(QTabs): shorter algorithm for onClick --- ui/src/components/tabs/QTab.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ui/src/components/tabs/QTab.js b/ui/src/components/tabs/QTab.js index a835370f2dd..ab877c45efc 100644 --- a/ui/src/components/tabs/QTab.js +++ b/ui/src/components/tabs/QTab.js @@ -152,20 +152,17 @@ export default Vue.extend({ // if requiring to go to another route, then we // let the QTabs route watcher do its job, // otherwise directly select this + let failed const reqId = sameInternalRoute === true ? (this.$tabs.avoidRouteWatcher = uid()) : null return this.$router[replace === true ? 'replace' : 'push'](resolvedLink.location) - .then(() => { - if (reqId === this.$tabs.avoidRouteWatcher) { - this.$tabs.__updateModel({ name: this.name }) - } - }) - .catch(() => {}) + .catch(() => { failed = true }) .finally(() => { if (reqId === this.$tabs.avoidRouteWatcher) { this.$tabs.avoidRouteWatcher = false + failed !== true && this.$tabs.__updateModel({ name: this.name }) } }) }