Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.

Commit e94af00

Browse files
committed
fix(widgetMixin): remove when InstantSearch is not yet started
This condition was needed in v2 (see #502), but no longer since the getConfiguration -> getWidgetSearchParameters change
1 parent 0e900ef commit e94af00

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/mixins/widget.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,15 @@ Read more on using connectors: https://alg.li/vue-custom`
5656
}
5757
},
5858
beforeDestroy() {
59-
if (
60-
this.widget &&
61-
this.widget.dispose &&
62-
this.instantSearchInstance.started // a widget can't be removed if IS is not started
63-
) {
59+
if (this.widget) {
6460
this.getParentIndex().removeWidgets([this.widget]);
6561
}
6662
},
6763
watch: {
6864
widgetParams: {
6965
handler(nextWidgetParams) {
7066
this.state = null;
71-
// a widget can't be removed if IS is not started
72-
if (this.widget.dispose && this.instantSearchInstance.started) {
73-
this.getParentIndex().removeWidgets([this.widget]);
74-
}
67+
this.getParentIndex().removeWidgets([this.widget]);
7568
this.widget = this.factory(nextWidgetParams);
7669
this.getParentIndex().addWidgets([this.widget]);
7770
},

0 commit comments

Comments
 (0)