Skip to content

Commit 5e0d390

Browse files
shwstpprdhslove
authored andcommitted
ui: clear selected resource when no items in listview (apache#11946)
Fixes apache#11922 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent d36bfd0 commit 5e0d390

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
@@ -1604,15 +1604,12 @@ export default {
16041604
}
16051605
}
16061606
}
1607-
if (this.items.length > 0) {
1608-
if (!this.showAction || this.dataView) {
1609-
this.resource = this.items[0]
1610-
this.$emit('change-resource', this.resource)
1611-
}
1612-
} else {
1613-
if (this.dataView) {
1614-
this.$router.push({ path: '/dashboard' })
1615-
}
1607+
if (this.items.length <= 0 && this.dataView) {
1608+
this.$router.push({ path: '/exception/404' })
1609+
}
1610+
if (!this.showAction || this.dataView) {
1611+
this.resource = this.items?.[0] || {}
1612+
this.$emit('change-resource', this.resource)
16161613
}
16171614
}).catch(error => {
16181615
if (!error || !error.message) {

0 commit comments

Comments
 (0)