Delay RustDesk provisioning until machineId is loaded
This commit is contained in:
parent
59e68b0032
commit
35de633b6f
1 changed files with 12 additions and 8 deletions
|
|
@ -847,12 +847,16 @@ const resolvedAppUrl = useMemo(() => {
|
|||
|
||||
const ensureRustdesk = useCallback(async () => {
|
||||
if (!store) return null
|
||||
if (!config?.machineId) {
|
||||
logDesktop("rustdesk:skip:no-machine-id")
|
||||
return null
|
||||
}
|
||||
setIsRustdeskProvisioning(true)
|
||||
try {
|
||||
const payload = await invoke<RustdeskProvisioningResult>("ensure_rustdesk_and_emit", {
|
||||
configString: RUSTDESK_CONFIG_STRING || null,
|
||||
password: RUSTDESK_DEFAULT_PASSWORD || null,
|
||||
machineId: config?.machineId ?? null,
|
||||
machineId: config.machineId,
|
||||
})
|
||||
await handleRustdeskProvision(payload)
|
||||
return payload
|
||||
|
|
@ -897,7 +901,7 @@ const resolvedAppUrl = useMemo(() => {
|
|||
}, [store, handleRustdeskProvision])
|
||||
|
||||
useEffect(() => {
|
||||
if (!store) return
|
||||
if (!store || !config?.machineId) return
|
||||
if (!rustdeskInfo && !isRustdeskProvisioning && !rustdeskBootstrapRef.current) {
|
||||
rustdeskBootstrapRef.current = true
|
||||
ensureRustdesk().finally(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue