chore: update upgrade version view (#1791)

This commit is contained in:
boojack
2023-06-03 14:32:04 +08:00
committed by GitHub
parent 32e2f1d339
commit 11a385cda6
13 changed files with 34 additions and 68 deletions

View File

@ -12,7 +12,6 @@ import "@/less/settings/system-section.less";
interface State {
dbSize: number;
allowSignUp: boolean;
ignoreUpgrade: boolean;
disablePublicMemos: boolean;
additionalStyle: string;
additionalScript: string;
@ -27,7 +26,6 @@ const SystemSection = () => {
const [state, setState] = useState<State>({
dbSize: systemStatus.dbSize,
allowSignUp: systemStatus.allowSignUp,
ignoreUpgrade: systemStatus.ignoreUpgrade,
additionalStyle: systemStatus.additionalStyle,
additionalScript: systemStatus.additionalScript,
disablePublicMemos: systemStatus.disablePublicMemos,
@ -82,17 +80,6 @@ const SystemSection = () => {
});
};
const handleIgnoreUpgradeChanged = async (value: boolean) => {
setState({
...state,
ignoreUpgrade: value,
});
await api.upsertSystemSetting({
name: "ignore-upgrade",
value: JSON.stringify(value),
});
};
const handleUpdateCustomizedProfileButtonClick = () => {
showUpdateCustomizedProfileDialog();
};
@ -261,10 +248,6 @@ const SystemSection = () => {
<span className="normal-text">{t("setting.system-section.allow-user-signup")}</span>
<Switch checked={state.allowSignUp} onChange={(event) => handleAllowSignUpChanged(event.target.checked)} />
</div>
<div className="form-label">
<span className="normal-text">{t("setting.system-section.ignore-version-upgrade")}</span>
<Switch checked={state.ignoreUpgrade} onChange={(event) => handleIgnoreUpgradeChanged(event.target.checked)} />
</div>
<div className="form-label">
<span className="normal-text">{t("setting.system-section.disable-public-memos")}</span>
<Switch checked={state.disablePublicMemos} onChange={(event) => handleDisablePublicMemosChanged(event.target.checked)} />