mirror of
https://github.com/immich-app/immich.git
synced 2025-11-24 23:40:45 +09:00
feat(web): improve slideshow quality of life (#18778)
* Add a new setting to toggle autoplay when showing the slideshow. * Fix an issue where the slideshow would restart automatically when navigating after it was paused. * Add a keyboard shortcut 's' to start the slideshow from the asset viewer. * Add a keyboard shortcut ' ' to toggle the slideshow play/paused. * Change the timeout for hiding the slideshow controls from 10 to 2.5 seconds. * Add English translation for the 'autoplay_slideshow' setting. Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -51,7 +51,11 @@
|
||||
|
||||
onMount(async () => {
|
||||
if (autoplay) {
|
||||
status = ProgressBarStatus.Playing;
|
||||
await play();
|
||||
} else {
|
||||
status = ProgressBarStatus.Paused;
|
||||
await progress.set(0);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -67,16 +71,15 @@
|
||||
await progress.set($progress);
|
||||
};
|
||||
|
||||
export const restart = async (autoplay: boolean) => {
|
||||
export const restart = async () => {
|
||||
await progress.set(0);
|
||||
|
||||
if (autoplay) {
|
||||
if (status !== ProgressBarStatus.Paused) {
|
||||
await play();
|
||||
}
|
||||
};
|
||||
|
||||
export const reset = async () => {
|
||||
status = ProgressBarStatus.Paused;
|
||||
export const resetProgress = async () => {
|
||||
await progress.set(0);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user