Skip to content

Commit a9e73bf

Browse files
committed
fix(mobile): hold the title regeneration guard until the watched request settles
1 parent 64126ae commit a9e73bf

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎apps/mobile/src/features/home/useThreadListActions.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,13 +535,15 @@ export function useThreadListActions(): {
535535
}
536536
return true;
537537
})();
538-
titleRegenerationInFlightThreadKeys.current.delete(key);
539538
if (succeeded) {
540-
void watch.failure.then((failure) => {
541-
if (failure !== null) Dialog.alert("Could not regenerate title", failure);
542-
});
539+
void watch.failure
540+
.then((failure) => {
541+
if (failure !== null) Dialog.alert("Could not regenerate title", failure);
542+
})
543+
.finally(() => titleRegenerationInFlightThreadKeys.current.delete(key));
543544
} else {
544545
watch.cancel();
546+
titleRegenerationInFlightThreadKeys.current.delete(key);
545547
}
546548
return succeeded;
547549
};

0 commit comments

Comments
 (0)