|
|
@ -200,6 +200,44 @@ function UserPromptModal(props: { onClose?: () => void }) {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function DangerItems() {
|
|
|
|
|
|
|
|
const chatStore = useChatStore();
|
|
|
|
|
|
|
|
const appConfig = useAppConfig();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<List>
|
|
|
|
|
|
|
|
<ListItem
|
|
|
|
|
|
|
|
title={Locale.Settings.Danger.Reset.Title}
|
|
|
|
|
|
|
|
subTitle={Locale.Settings.Danger.Reset.SubTitle}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<IconButton
|
|
|
|
|
|
|
|
text={Locale.Settings.Danger.Reset.Action}
|
|
|
|
|
|
|
|
onClick={async () => {
|
|
|
|
|
|
|
|
if (await showConfirm(Locale.Settings.Danger.Reset.Confirm)) {
|
|
|
|
|
|
|
|
appConfig.reset();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
type="danger"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</ListItem>
|
|
|
|
|
|
|
|
<ListItem
|
|
|
|
|
|
|
|
title={Locale.Settings.Danger.Clear.Title}
|
|
|
|
|
|
|
|
subTitle={Locale.Settings.Danger.Clear.SubTitle}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<IconButton
|
|
|
|
|
|
|
|
text={Locale.Settings.Danger.Clear.Action}
|
|
|
|
|
|
|
|
onClick={async () => {
|
|
|
|
|
|
|
|
if (await showConfirm(Locale.Settings.Danger.Clear.Confirm)) {
|
|
|
|
|
|
|
|
chatStore.clearAllData();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
type="danger"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</ListItem>
|
|
|
|
|
|
|
|
</List>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function SyncItems() {
|
|
|
|
function SyncItems() {
|
|
|
|
const syncStore = useSyncStore();
|
|
|
|
const syncStore = useSyncStore();
|
|
|
|
const webdav = syncStore.webDavConfig;
|
|
|
|
const webdav = syncStore.webDavConfig;
|
|
|
@ -290,7 +328,6 @@ export function Settings() {
|
|
|
|
const [showEmojiPicker, setShowEmojiPicker] = useState(false);
|
|
|
|
const [showEmojiPicker, setShowEmojiPicker] = useState(false);
|
|
|
|
const config = useAppConfig();
|
|
|
|
const config = useAppConfig();
|
|
|
|
const updateConfig = config.update;
|
|
|
|
const updateConfig = config.update;
|
|
|
|
const resetConfig = config.reset;
|
|
|
|
|
|
|
|
const chatStore = useChatStore();
|
|
|
|
const chatStore = useChatStore();
|
|
|
|
|
|
|
|
|
|
|
|
const updateStore = useUpdateStore();
|
|
|
|
const updateStore = useUpdateStore();
|
|
|
@ -375,40 +412,13 @@ export function Settings() {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="window-actions">
|
|
|
|
<div className="window-actions">
|
|
|
|
<div className="window-action-button">
|
|
|
|
<div className="window-action-button"></div>
|
|
|
|
<IconButton
|
|
|
|
<div className="window-action-button"></div>
|
|
|
|
icon={<ClearIcon />}
|
|
|
|
|
|
|
|
onClick={async () => {
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
await showConfirm(Locale.Settings.Actions.ConfirmClearAll)
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
chatStore.clearAllData();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
bordered
|
|
|
|
|
|
|
|
title={Locale.Settings.Actions.ClearAll}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="window-action-button">
|
|
|
|
|
|
|
|
<IconButton
|
|
|
|
|
|
|
|
icon={<ResetIcon />}
|
|
|
|
|
|
|
|
onClick={async () => {
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
await showConfirm(Locale.Settings.Actions.ConfirmResetAll)
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
resetConfig();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
bordered
|
|
|
|
|
|
|
|
title={Locale.Settings.Actions.ResetAll}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="window-action-button">
|
|
|
|
<div className="window-action-button">
|
|
|
|
<IconButton
|
|
|
|
<IconButton
|
|
|
|
icon={<CloseIcon />}
|
|
|
|
icon={<CloseIcon />}
|
|
|
|
onClick={() => navigate(Path.Home)}
|
|
|
|
onClick={() => navigate(Path.Home)}
|
|
|
|
bordered
|
|
|
|
bordered
|
|
|
|
title={Locale.Settings.Actions.Close}
|
|
|
|
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -691,6 +701,8 @@ export function Settings() {
|
|
|
|
{shouldShowPromptModal && (
|
|
|
|
{shouldShowPromptModal && (
|
|
|
|
<UserPromptModal onClose={() => setShowPromptModal(false)} />
|
|
|
|
<UserPromptModal onClose={() => setShowPromptModal(false)} />
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<DangerItems />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</ErrorBoundary>
|
|
|
|
</ErrorBoundary>
|
|
|
|
);
|
|
|
|
);
|
|
|
|