diff --git a/src/core/services/subsync-files.ts b/src/core/services/subsync-files.ts index 2af41957..36f50d8b 100644 --- a/src/core/services/subsync-files.ts +++ b/src/core/services/subsync-files.ts @@ -509,10 +509,11 @@ export async function loadSyncedSubtitle( if (addedTrackId === null) { throw new Error('Synchronized subtitle did not appear in the mpv track list'); } - signal?.throwIfAborted(); // The lookup polls for a while; if the user picked another secondary track meanwhile, // keep their choice (and delay) rather than overriding it. - if ((await client.requestProperty('secondary-sid')) !== secondaryBeforeAdd) { + const secondaryAfterLookup = await client.requestProperty('secondary-sid'); + signal?.throwIfAborted(); + if (secondaryAfterLookup !== secondaryBeforeAdd) { throw new Error( `Secondary subtitle changed while loading; saved the synced file at ${pathToLoad} without selecting it.`, );