1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: Fix keyboard can't add text after certain error/info dialogs are shown (#11603)

This commit is contained in:
Henry Heino
2025-01-08 04:30:16 -08:00
committed by GitHub
parent 633d87ebfe
commit e1e2ba8888
12 changed files with 36 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ import { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/
import { _ } from '@joplin/lib/locale';
import ShareService from '@joplin/lib/services/share/ShareService';
import Logger from '@joplin/utils/Logger';
import shim from '@joplin/lib/shim';
const logger = Logger.create('leaveSharedFolder');
@@ -13,7 +14,7 @@ export const declaration: CommandDeclaration = {
export const runtime = (): CommandRuntime => {
return {
execute: async (_context: CommandContext, folderId: string = null) => {
const answer = confirm(_('This will remove the notebook from your collection and you will no longer have access to its content. Do you wish to continue?'));
const answer = await shim.showConfirmationDialog(_('This will remove the notebook from your collection and you will no longer have access to its content. Do you wish to continue?'));
if (!answer) return;
try {
@@ -28,7 +29,7 @@ export const runtime = (): CommandRuntime => {
await ShareService.instance().leaveSharedFolder(folderId, share.user.id);
} catch (error) {
logger.error(error);
alert(_('Error: %s', error.message));
await shim.showErrorDialog(_('Error: %s', error.message));
}
},
enabledCondition: 'joplinServerConnected && folderIsShareRootAndNotOwnedByUser',