Skip to content

Commit 301f0d9

Browse files
committed
fix(Exercises): set the inputText to the correct title when selecting a favorite
1 parent cac87b6 commit 301f0d9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

components/Panel/Item/FavoritePanel.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
searchRequest.data = searchCriterion;
131131
132132
await this.$accessor.exercises.fetch(searchRequest);
133+
134+
this.$emit('fetch');
133135
}
134136
}
135137
</script>

pages/exercices/index.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</PanelItem>
2121

2222
<PanelItem :is-active="$auth.loggedIn">
23-
<FavoritePanel/>
23+
<FavoritePanel @fetch="setInput"/>
2424
</PanelItem>
2525
</Panel>
2626
<ExercisesPanel @reset="resetInput"/>
@@ -92,9 +92,13 @@
9292
this.inputText.value = ""
9393
}
9494
95-
mounted() {
95+
setInput() {
9696
const title = this.$accessor.exercises.search_criterion.title;
97-
this.inputText.value = !!title ? title : ''
97+
this.inputText.value = !!title ? title : '';
98+
}
99+
100+
mounted() {
101+
this.setInput();
98102
}
99103
}
100104
</script>

0 commit comments

Comments
 (0)