feat: add acknowledgment checkbox for version changes in advanced settings

This commit is contained in:
Adam Shiervani 2025-11-06 11:54:50 +01:00 committed by Siyuan
parent 32c66a3897
commit e0ff6716f1
1 changed files with 12 additions and 2 deletions

View File

@ -32,6 +32,7 @@ export default function SettingsAdvancedRoute() {
const [appVersion, setAppVersion] = useState<string>(""); const [appVersion, setAppVersion] = useState<string>("");
const [systemVersion, setSystemVersion] = useState<string>(""); const [systemVersion, setSystemVersion] = useState<string>("");
const [resetConfig, setResetConfig] = useState(false); const [resetConfig, setResetConfig] = useState(false);
const [versionChangeAcknowledged, setVersionChangeAcknowledged] = useState(false);
const settings = useSettingsStore(); const settings = useSettingsStore();
@ -355,7 +356,15 @@ export default function SettingsAdvancedRoute() {
checked={resetConfig} checked={resetConfig}
onChange={e => setResetConfig(e.target.checked)} onChange={e => setResetConfig(e.target.checked)}
/> />
</div> </div>
<div>
<CheckboxWithLabel
label="I understand version changes may break my device and require factory reset"
checked={versionChangeAcknowledged}
onChange={e => setVersionChangeAcknowledged(e.target.checked)}
/>
</div>
<Button <Button
size="SM" size="SM"
@ -364,7 +373,8 @@ export default function SettingsAdvancedRoute() {
disabled={ disabled={
(updateTarget === "app" && !appVersion) || (updateTarget === "app" && !appVersion) ||
(updateTarget === "system" && !systemVersion) || (updateTarget === "system" && !systemVersion) ||
(updateTarget === "both" && (!appVersion || !systemVersion)) (updateTarget === "both" && (!appVersion || !systemVersion)) ||
!versionChangeAcknowledged
} }
onClick={handleVersionUpdate} onClick={handleVersionUpdate}
/> />