Skip to content

Commit

Permalink
Replace another confirm with shim.showConfirmationDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator committed Jan 7, 2025
1 parent 12eccc5 commit c411e1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import shouldShowMissingPasswordWarning from '@joplin/lib/components/shared/conf
import MacOSMissingPasswordHelpLink from './controls/MissingPasswordHelpLink';
const { KeymapConfigScreen } = require('../KeymapConfig/KeymapConfigScreen');
import SettingComponent, { UpdateSettingValueEvent } from './controls/SettingComponent';
import shim from '@joplin/lib/shim';


interface Font {
Expand Down Expand Up @@ -144,7 +145,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
screenName = section.name;

if (this.hasChanges()) {
const ok = confirm(_('This will open a new screen. Save your current changes?'));
const ok = await shim.showConfirmationDialog(_('This will open a new screen. Save your current changes?'));
if (ok) {
await shared.saveSettings(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ function ShareFolderDialog(props: Props) {

async function buttonRow_click(event: ClickEvent) {
if (event.buttonName === 'unshare') {
if (!confirm(_('Unshare this notebook? The recipients will no longer have access to its content.'))) return;
if (!await shim.showConfirmationDialog(_('Unshare this notebook? The recipients will no longer have access to its content.'))) {
return;
}
await ShareService.instance().unshareFolder(props.folderId);
void synchronize();
}
Expand Down

0 comments on commit c411e1c

Please sign in to comment.