enhance (frontend): stop ModPlayer when unmounted.

This commit is contained in:
Vavency 2024-01-23 21:24:05 +02:00
parent 54cd51df5a
commit 1fb7498be5

View file

@ -36,7 +36,7 @@
</template>
<script lang="ts" setup>
import { ref, nextTick, computed, watch } from 'vue';
import { ref, nextTick, computed, watch, onDeactivated } from 'vue';
import * as Misskey from 'misskey-js';
import { i18n } from '@/i18n.js';
import { defaultStore } from '@/store.js';
@ -401,6 +401,10 @@ watch(patternScrollSliderPos, () => {
displayCanvas.value.parentElement.scrollLeft = (displayCanvas.value.width - displayCanvas.value.parentElement.offsetWidth) * patternScrollSliderPos.value / 100;
});
onDeactivated(() => {
stop();
});
</script>
<style lang="scss" scoped>