mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
Co-authored-by: orca-bug-scan-bot <orca-bug-scan-bot@stably.ai>
This commit is contained in:
co-authored by
orca-bug-scan-bot
parent
9bc8166ad8
commit
8d9b629b26
@@ -785,14 +785,18 @@ export default function TaskPage(): React.JSX.Element {
|
||||
}
|
||||
}, [pageData.taskSource])
|
||||
|
||||
// Why: settings.defaultTaskSource can change while Tasks is open (Settings
|
||||
// panel is reachable without unmounting Tasks). The one-shot resume effect
|
||||
// only seeds taskSource on first mount, so without this sync a mid-session
|
||||
// change to the default would not propagate when no explicit page-level
|
||||
// taskSource was passed.
|
||||
// Why: when settings hydrate after Tasks mounts, seed taskSource from
|
||||
// defaultTaskSource — but only once. Re-running on every defaultTaskSource
|
||||
// change would clobber an in-session manual source pick (e.g. the user
|
||||
// clicked the Linear icon and then changed the default in Settings).
|
||||
const defaultTaskSourceSeededRef = useRef(false)
|
||||
useEffect(() => {
|
||||
if (defaultTaskSourceSeededRef.current) {
|
||||
return
|
||||
}
|
||||
if (!pageData.taskSource && settings?.defaultTaskSource) {
|
||||
setTaskSource(settings.defaultTaskSource)
|
||||
defaultTaskSourceSeededRef.current = true
|
||||
}
|
||||
}, [settings?.defaultTaskSource, pageData.taskSource])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user