Skip to content

Commit

Permalink
Desktop: Fixes #9970: Focus is lost when the hyperlink modal is cance…
Browse files Browse the repository at this point in the history
…lled (#10258)

Signed-off-by: Fabio Neto <fabiogvdneto@tecnico.ulisboa.pt>
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
  • Loading branch information
fabiogvdneto and laurent22 committed Apr 10, 2024
1 parent 837826e commit 514a8cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/app-desktop/gui/dialogs.ts
Expand Up @@ -24,13 +24,14 @@ class Dialogs {

// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
public async prompt(message: string, title = '', defaultValue = '', options: any = null) {
if (options === null) options = {};
options = { cancel: true, ...options };

try {
// https://github.com/laurent22/joplin/pull/10258#discussion_r1550306545
const answer = await smalltalk.prompt(title, message, defaultValue, options);
return answer;
} catch (error) {
logger.error(error);
logger.warn('Prompt appears to have been cancelled:', error);
return null;
}
}
Expand Down

0 comments on commit 514a8cf

Please sign in to comment.