Skip to content

Commit

Permalink
fix: auto mode stops when text is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
gudzpoz committed Jun 28, 2024
1 parent 26e230f commit 6b5b1b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/viewer/AnimatedText.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, watch } from 'vue';
import { nextTick, ref, watch } from 'vue';
const props = defineProps<{
html: string,
Expand Down Expand Up @@ -63,7 +63,8 @@ function startAnimation() {
);
}
div.style.display = '';
popChar(0, 0);
nextTick(() => requestAnimationFrame(() => popChar(0, 0)));
}
startAnimation();
watch(() => props.html, startAnimation);
Expand Down
2 changes: 1 addition & 1 deletion src/components/viewer/StoryTeller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async function updateStory(chunk?: string) {
await story.reload(s);
preloading.value = false;
auto.value = false;
autoSpeed.value = 1;
// autoSpeed.value = 1; // Do not reset autoSpeed
nextLine();
}
updateStory(props.chunk);
Expand Down

0 comments on commit 6b5b1b5

Please sign in to comment.