mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 04:02:41 +08:00
feat: replace window.confirm with showConfirm
This commit is contained in:
@@ -5,6 +5,7 @@ import ResetIcon from "../icons/reload.svg";
|
||||
import { ISSUE_URL } from "../constant";
|
||||
import Locale from "../locales";
|
||||
import { downloadAs } from "../utils";
|
||||
import { showConfirm } from "./ui-lib";
|
||||
|
||||
interface IErrorBoundaryState {
|
||||
hasError: boolean;
|
||||
@@ -57,10 +58,13 @@ export class ErrorBoundary extends React.Component<any, IErrorBoundaryState> {
|
||||
<IconButton
|
||||
icon={<ResetIcon />}
|
||||
text="Clear All Data"
|
||||
onClick={() =>
|
||||
confirm(Locale.Settings.Actions.ConfirmClearAll) &&
|
||||
this.clearAndSaveData()
|
||||
}
|
||||
onClick={async () => {
|
||||
if (
|
||||
await showConfirm(Locale.Settings.Actions.ConfirmClearAll)
|
||||
) {
|
||||
this.clearAndSaveData();
|
||||
}
|
||||
}}
|
||||
bordered
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user