Skip to content

Commit

Permalink
computedからrefとwatchに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
sigprogramming committed Dec 26, 2024
1 parent ababe83 commit b676c4a
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/components/Sing/ExportOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
</template>

<script setup lang="ts">
import { computed } from "vue";
import { computed, ref, watch } from "vue";
import { useStore } from "@/store";
import { ExhaustiveError } from "@/type/utility";
const store = useStore();
Expand All @@ -33,19 +34,27 @@ const nowRendering = computed(() => {
const nowExporting = computed(() => {
return store.state.exportState !== "NOT_EXPORTING";
});
const exportingMediaName = computed(() => {
if (store.state.exportState === "EXPORTING_AUDIO") {
return "音声";
} else if (store.state.exportState === "EXPORTING_LABEL") {
return "labファイル";
} else {
return "";
}
});
const cancelExport = () => {
void store.actions.CANCEL_EXPORT();
};
const exportingMediaName = ref("");
watch(
() => store.state.exportState,
() => {
if (store.state.exportState === "NOT_EXPORTING") {
return;
} else if (store.state.exportState === "EXPORTING_AUDIO") {
exportingMediaName.value = "音声";
} else if (store.state.exportState === "EXPORTING_LABEL") {
exportingMediaName.value = "labファイル";
} else {
throw new ExhaustiveError(store.state.exportState);
}
},
);
</script>

<style scoped lang="scss">
Expand Down

0 comments on commit b676c4a

Please sign in to comment.