You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Chore: Desktop: Fix electronApp.evaluate-related test failure (#12216)
This commit is contained in:
@@ -5,6 +5,7 @@ import uuid from '@joplin/lib/uuid';
|
||||
import createStartupArgs from './createStartupArgs';
|
||||
import getMainWindow from './getMainWindow';
|
||||
import setDarkMode from './setDarkMode';
|
||||
import evaluateWithRetry from './evaluateWithRetry';
|
||||
|
||||
|
||||
type StartWithPluginsResult = { app: ElectronApplication; mainWindow: Page };
|
||||
@@ -32,8 +33,8 @@ const initializeMainWindow = async (electronApp: ElectronApplication) => {
|
||||
return mainWindow;
|
||||
};
|
||||
|
||||
const waitForMainMessage = (electronApp: ElectronApplication, messageId: string) => {
|
||||
return electronApp.evaluate(({ ipcMain }, messageId) => {
|
||||
const waitForMainMessage = async (electronApp: ElectronApplication, messageId: string) => {
|
||||
return evaluateWithRetry(electronApp, ({ ipcMain }, messageId) => {
|
||||
return new Promise<void>(resolve => {
|
||||
ipcMain.once(messageId, () => resolve());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user