mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 21:44:59 +08:00
Update: Confirmation on reset chats and settings
This commit is contained in:
@@ -156,7 +156,14 @@ export function Settings(props: { closeSettings: () => void }) {
|
||||
<div className={styles["window-action-button"]}>
|
||||
<IconButton
|
||||
icon={<ClearIcon />}
|
||||
onClick={clearSessions}
|
||||
onClick={() => {
|
||||
const confirmed = window.confirm(
|
||||
`${Locale.Settings.Actions.ConfirmClearAll.Confirm}`,
|
||||
);
|
||||
if (confirmed) {
|
||||
clearSessions();
|
||||
}
|
||||
}}
|
||||
bordered
|
||||
title={Locale.Settings.Actions.ClearAll}
|
||||
/>
|
||||
@@ -164,7 +171,14 @@ export function Settings(props: { closeSettings: () => void }) {
|
||||
<div className={styles["window-action-button"]}>
|
||||
<IconButton
|
||||
icon={<ResetIcon />}
|
||||
onClick={resetConfig}
|
||||
onClick={() => {
|
||||
const confirmed = window.confirm(
|
||||
`${Locale.Settings.Actions.ConfirmResetAll.Confirm}`,
|
||||
);
|
||||
if (confirmed) {
|
||||
resetConfig();
|
||||
}
|
||||
}}
|
||||
bordered
|
||||
title={Locale.Settings.Actions.ResetAll}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user