#56 - remove last track from activeTracks on disable compare mode

This commit is contained in:
isUnknown 2024-12-17 15:13:34 +01:00
parent af61f49e2b
commit d30cd89b4f

View file

@ -35,7 +35,7 @@
</div>
</template>
<script setup>
import { ref, computed } from "vue";
import { ref, computed, watch } from "vue";
import { storeToRefs } from "pinia";
import { usePageStore } from "../../../stores/page";
import Interactive360 from "./Interactive360.vue";
@ -47,6 +47,11 @@ const tracks = computed(
);
const isCompareModeEnabled = ref(false);
watch(isCompareModeEnabled, (newValue) => {
if (!newValue) {
activeTracks.value.pop();
}
});
const activeTracks = ref([tracks.value[0]]);