Skip to content

Commit a4dcc86

Browse files
shwstpprLocharla, Sandeep
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 03975f1 commit a4dcc86

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
@@ -1196,15 +1196,12 @@ export default {
11961196
}
11971197
}
11981198
}
1199-
if (this.items.length > 0) {
1200-
if (!this.showAction || this.dataView) {
1201-
this.resource = this.items[0]
1202-
this.$emit('change-resource', this.resource)
1203-
}
1204-
} else {
1205-
if (this.dataView) {
1206-
this.$router.push({ path: '/exception/404' })
1207-
}
1199+
if (this.items.length <= 0 && this.dataView) {
1200+
this.$router.push({ path: '/exception/404' })
1201+
}
1202+
if (!this.showAction || this.dataView) {
1203+
this.resource = this.items?.[0] || {}
1204+
this.$emit('change-resource', this.resource)
12081205
}
12091206
}).catch(error => {
12101207
if (!error || !error.message) {

0 commit comments

Comments
 (0)