File tree Expand file tree Collapse file tree
immichFrame.Web/src/lib/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828
2929 const onChange = async (progressDuration : number ) => {
3030 progress = setDuration (progressDuration );
31- await play ();
31+ if (status === ProgressBarStatus .Playing ) {
32+ await play ();
33+ }
3234 };
3335
3436 let progress = setDuration (duration );
Original file line number Diff line number Diff line change 149149 }
150150 }
151151
152- let isHandlingAssetTransition = false ;
152+ let transitionLock: Promise <void > = Promise .resolve ();
153+
153154 const handleDone = async (previous : boolean = false , instant : boolean = false ) => {
154- if (isHandlingAssetTransition ) {
155- return ;
156- }
157- isHandlingAssetTransition = true ;
158- try {
159- userPaused = false ;
160- progressBar .restart (false );
161- $instantTransition = instant ;
162- if (previous ) await getPreviousAssets ();
163- else await getNextAssets ();
164- await tick ();
165- await assetComponent ?.play ?.();
166- progressBar .play ();
167- } finally {
168- isHandlingAssetTransition = false ;
169- }
155+ transitionLock = transitionLock
156+ .then (async () => {
157+ userPaused = false ;
158+ progressBar .restart (false );
159+ $instantTransition = instant ;
160+ if (previous ) await getPreviousAssets ();
161+ else await getNextAssets ();
162+ await tick ();
163+ await assetComponent ?.play ?.();
164+ progressBar .play ();
165+ })
166+ .catch ((err ) => {
167+ console .error (' handleDone transition failed:' , err );
168+ });
169+ await transitionLock ;
170170 };
171171
172172 async function getNextAssets() {
You can’t perform that action at this time.
0 commit comments