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
parent 931413acd9
commit 8c88f72ba4
1 changed files with 12 additions and 2 deletions

View File

@ -31,6 +31,7 @@ export default function SettingsAdvancedRoute() {
const [appVersion, setAppVersion] = useState<string>("");
const [systemVersion, setSystemVersion] = useState<string>("");
const [resetConfig, setResetConfig] = useState(false);
const [versionChangeAcknowledged, setVersionChangeAcknowledged] = useState(false);
const settings = useSettingsStore();
@ -354,7 +355,15 @@ export default function SettingsAdvancedRoute() {
checked={resetConfig}
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
size="SM"
@ -363,7 +372,8 @@ export default function SettingsAdvancedRoute() {
disabled={
(updateTarget === "app" && !appVersion) ||
(updateTarget === "system" && !systemVersion) ||
(updateTarget === "both" && (!appVersion || !systemVersion))
(updateTarget === "both" && (!appVersion || !systemVersion)) ||
!versionChangeAcknowledged
}
onClick={handleVersionUpdate}
/>