Skip to content

Commit 77ea340

Browse files
authored
feat: Hide Removed Favorite Items - MEED-9612 - Meeds-io/meeds#3575 (#1957)
This change will allow to Hide not found favorite items from Favorite Drawer.
1 parent 0e05d25 commit 77ea340

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

portlets/src/main/webapp/vue-app/favorite-drawer-extension/components/RuleFavoriteItem.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<v-list-item
3+
v-if="rule"
34
:href="ruleUrl"
45
@keydown.enter="setAsViewed"
56
@auxclick="setAsViewed"
@@ -76,7 +77,7 @@ export default {
7677
},
7778
data: () => ({
7879
isFavorite: true,
79-
rule: {},
80+
rule: null,
8081
}),
8182
computed: {
8283
iconWidth() {
@@ -110,10 +111,14 @@ export default {
110111
return this.expanded ? 22 : 16;
111112
},
112113
},
113-
created() {
114-
this.$ruleService.getRuleById(this.ruleId, {
115-
lang: eXo.env.portal.language,
116-
}).then(rule => this.rule = rule);
114+
async created() {
115+
try {
116+
this.rule = await this.$ruleService.getRuleById(this.ruleId, {
117+
lang: eXo.env.portal.language,
118+
});
119+
} catch {
120+
this.$root.$emit('favorite-removed', 'rule', this.id);
121+
}
117122
},
118123
methods: {
119124
removed() {

0 commit comments

Comments
 (0)