Move mobile tasks client ref sync out of effect (#3253)

* Move mobile tasks client ref sync out of effect

* Use layout effect for mobile tasks client ref

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Neil 2026-05-29 19:13:19 -07:00 committed by GitHub
parent 56f761d93d
commit 2e185a7c4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
import type { ReactNode } from 'react'
import {
ActivityIndicator,
@ -2534,7 +2534,9 @@ export default function MobileTasksScreen() {
return [...logins].sort().join(',')
}, [projectRowDetail, projectRowItem?.content.assignees])
useEffect(() => {
// Why: task-loading effects use this as a stale-client guard, so the ref
// must be current before those passive effects can run after commit.
useLayoutEffect(() => {
clientRef.current = client
}, [client])