fix: eliminate blank overlay flash when opening ShareModal
Initialize hasRelationship and isCheckingRelationship based on whether factoryId is present, so the first render frame already shows the correct content instead of an empty backdrop overlay. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a3e9361cab
commit
aba6330db7
@ -66,8 +66,10 @@ export function ShareModal({
|
||||
const shortLinkGenerated = useRef(false);
|
||||
|
||||
// 新流程状态
|
||||
const [hasRelationship, setHasRelationship] = useState<boolean | null>(null);
|
||||
const [isCheckingRelationship, setIsCheckingRelationship] = useState(false);
|
||||
// When no factoryId (unlinked plan), we already know there's no relationship
|
||||
// so initialize directly to avoid a blank-overlay flash before useEffect runs.
|
||||
const [hasRelationship, setHasRelationship] = useState<boolean | null>(factoryId ? null : false);
|
||||
const [isCheckingRelationship, setIsCheckingRelationship] = useState(!!factoryId);
|
||||
const [existingLink, setExistingLink] = useState<ShareLinkStatus | null>(null);
|
||||
const [isGeneratingLink, setIsGeneratingLink] = useState(false);
|
||||
const [pushSuccess, setPushSuccess] = useState(false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user