fix(ui): shouldn't pass custom version to onConfirmCustomUpdate if not available

This commit is contained in:
Siyuan 2025-11-10 13:48:23 +00:00
parent 3fab951d43
commit 0cc84f0c54
1 changed files with 2 additions and 3 deletions

View File

@ -101,10 +101,9 @@ export function Dialog({
const { modalView, setModalView, otaState } = useUpdateStore();
const forceCustomUpdate = customSystemVersion !== undefined || customAppVersion !== undefined;
const onConfirmCustomUpdate = useCallback(() => {
console.debug("onConfirmCustomUpdate", customAppVersion, customSystemVersion, versionInfo);
onConfirmCustomUpdateCallback(
customAppVersion !== undefined ? customAppVersion : versionInfo?.remote?.appVersion,
customSystemVersion !== undefined ? customSystemVersion : versionInfo?.remote?.systemVersion,
customAppVersion !== undefined ? versionInfo?.remote?.appVersion : undefined,
customSystemVersion !== undefined ? versionInfo?.remote?.systemVersion : undefined,
);
}, [onConfirmCustomUpdateCallback, customAppVersion, customSystemVersion, versionInfo]);