Skip to content

Commit 5221ac1

Browse files
committed
chore(QTabs): shorter algorithm for onClick
1 parent f5671d5 commit 5221ac1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ui/src/components/tabs/QTab.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,17 @@ export default Vue.extend({
152152
// if requiring to go to another route, then we
153153
// let the QTabs route watcher do its job,
154154
// otherwise directly select this
155+
let failed
155156
const reqId = sameInternalRoute === true
156157
? (this.$tabs.avoidRouteWatcher = uid())
157158
: null
158159

159160
return this.$router[replace === true ? 'replace' : 'push'](resolvedLink.location)
160-
.then(() => {
161-
if (reqId === this.$tabs.avoidRouteWatcher) {
162-
this.$tabs.__updateModel({ name: this.name })
163-
}
164-
})
165-
.catch(() => {})
161+
.catch(() => { failed = true })
166162
.finally(() => {
167163
if (reqId === this.$tabs.avoidRouteWatcher) {
168164
this.$tabs.avoidRouteWatcher = false
165+
failed !== true && this.$tabs.__updateModel({ name: this.name })
169166
}
170167
})
171168
}

0 commit comments

Comments
 (0)