Skip to content

Commit b42aaf8

Browse files
AlexanderDevitskyAlexander Devitsky
authored andcommitted
fix: fixed InstagramFeed component (#557)
Co-authored-by: Alexander Devitsky <[email protected]>
1 parent 9f14e65 commit b42aaf8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/theme/components/InstagramFeed.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,21 @@ import {
8484
mapMobileObserver,
8585
unMapMobileObserver,
8686
} from '@storefront-ui/vue/src/utilities/mobile-observer.js';
87-
import { defineComponent } from '@nuxtjs/composition-api';
87+
import { computed, defineComponent, onBeforeUnmount } from '@nuxtjs/composition-api';
8888
8989
export default defineComponent({
9090
name: 'InstagramFeed',
9191
components: {
9292
SfSection,
9393
},
94-
computed: {
95-
...mapMobileObserver(),
96-
},
97-
beforeDestroy() {
98-
unMapMobileObserver();
94+
setup() {
95+
const isMobile = computed(() => mapMobileObserver().isMobile.get());
96+
97+
onBeforeUnmount(() => {
98+
unMapMobileObserver();
99+
});
100+
101+
return { isMobile };
99102
},
100103
});
101104
</script>

0 commit comments

Comments
 (0)