Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
martabal committed Mar 21, 2024
1 parent 4d9a8ac commit 524224d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion web/src/lib/components/asset-viewer/asset-viewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@
onSetToFullScreen={() => assetViewerHtmlElement.requestFullscreen()}
onPrevious={() => navigateAsset('previous')}
onNext={() => navigateAsset('next')}
onClose={handleStopSlideshow}
onClose={() => ($slideshowState = SlideshowState.StopSlideshow)}
/>
</div>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion web/src/lib/components/asset-viewer/slideshow-bar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@
duration={$slideshowDelay}
bind:this={progressBar}
bind:status={progressBarStatus}
onDone={handleDone}
on:done={handleDone}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script lang="ts">
import { handlePromiseError } from '$lib/utils';
import { onMount } from 'svelte';
import { createEventDispatcher, onMount } from 'svelte';
import { tweened } from 'svelte/motion';
/**
Expand All @@ -26,10 +26,6 @@
export let duration = 5;
export let onDone: () => void;
export let onPlaying: (() => void) | undefined = undefined;
export let onPaused: (() => void) | undefined = undefined;
const onChange = async () => {
progress = setDuration(duration);
await play();
Expand All @@ -41,10 +37,16 @@
$: {
if ($progress === 1) {
onDone();
dispatch('done');
}
}
const dispatch = createEventDispatcher<{
done: void;
playing: void;
paused: void;
}>();
onMount(async () => {
if (autoplay) {
await play();
Expand All @@ -53,13 +55,13 @@
export const play = async () => {
status = ProgressBarStatus.Playing;
onPlaying && onPlaying();
dispatch('playing');
await progress.set(1);
};
export const pause = async () => {
status = ProgressBarStatus.Paused;
onPaused && onPaused();
dispatch('paused');
await progress.set($progress);
};
Expand Down

0 comments on commit 524224d

Please sign in to comment.