fix: explicitly assign a value to `cancelId` for ‘Clear All Data' dialog (#1624)

This commit is contained in:
Eric Zhu 2024-11-16 17:25:41 +08:00 committed by GitHub
parent 9ec3fe562b
commit fdb87cf5cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import { promisify } from "node:util"
import { callWindowExpose } from "@follow/shared/bridge"
import { app, dialog } from "electron"
import { getIconPath } from "~/helper"
import { logger } from "~/logger"
import { getMainWindow } from "~/window"
@ -23,9 +24,10 @@ export const clearAllDataAndConfirm = async () => {
// Dialog to confirm
const result = await dialog.showMessageBox({
type: "warning",
icon: getIconPath(),
message: t("dialog.clearAllData"),
buttons: [t("dialog.yes"), t("dialog.no")],
cancelId: 1,
})
if (result.response === 1) {