1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Fixes #7484: Window is white on startup

This commit is contained in:
Laurent Cozic 2023-06-05 17:49:34 +01:00
parent 77505e3c75
commit 45877f8b26
2 changed files with 11 additions and 1 deletions

View File

@ -553,7 +553,15 @@ class Application extends BaseApplication {
bridge().addEventListener('nativeThemeUpdated', this.bridge_nativeThemeUpdated);
await this.initPluginService();
// We need to delay plugin initialisation until the main screen is
// ready. Otherwise plugins might try to modify the application layout,
// which will cause an error related to an empty layout item. This in
// turns will cause the screen to go white on startup.
//
// https://discourse.joplinapp.org/t/upgrade-produces-blank-window/31138/8
eventManager.on('mainScreenReady', () => {
void this.initPluginService();
});
this.setupContextMenu();

View File

@ -46,6 +46,7 @@ import PromptDialog from '../PromptDialog';
import NotePropertiesDialog from '../NotePropertiesDialog';
const PluginManager = require('@joplin/lib/services/PluginManager');
const ipcRenderer = require('electron').ipcRenderer;
import eventManager from '@joplin/lib/eventManager';
interface LayerModalState {
visible: boolean;
@ -391,6 +392,7 @@ class MainScreenComponent extends React.Component<Props, State> {
public componentDidMount() {
window.addEventListener('keydown', this.layoutModeListenerKeyDown);
eventManager.emit('mainScreenReady');
}
public componentWillUnmount() {