Skip to content

Commit 2ab7188

Browse files
committed
ui: clear selected resource when no items in listview
Fixes #11922 Signed-off-by: Abhishek Kumar <[email protected]>
1 parent bfc4f60 commit 2ab7188

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

ui/src/views/AutogenView.vue

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,15 +1191,12 @@ export default {
11911191
}
11921192
}
11931193
}
1194-
if (this.items.length > 0) {
1195-
if (!this.showAction || this.dataView) {
1196-
this.resource = this.items[0]
1197-
this.$emit('change-resource', this.resource)
1198-
}
1199-
} else {
1200-
if (this.dataView) {
1201-
this.$router.push({ path: '/exception/404' })
1202-
}
1194+
if (this.items.length <= 0 && this.dataView) {
1195+
this.$router.push({ path: '/exception/404' })
1196+
}
1197+
if (!this.showAction || this.dataView) {
1198+
this.resource = this.items?.[0] || {}
1199+
this.$emit('change-resource', this.resource)
12031200
}
12041201
}).catch(error => {
12051202
if (!error || !error.message) {

0 commit comments

Comments
 (0)