You've already forked joplin
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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user