Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank page when app started / no content #842

Closed
nazar322 opened this issue Apr 17, 2024 · 1 comment
Closed

Blank page when app started / no content #842

nazar322 opened this issue Apr 17, 2024 · 1 comment
Labels

Comments

@nazar322
Copy link

nazar322 commented Apr 17, 2024

  • Version: 23.6.2
  • Target: win-x64, osx

In the built application sometimes the content is not loaded and therefore there is a blank space in the client area.
I have attached the screenshot.
Having googled the issue I see many have the same problem with just an electron and the typical solution would be changing the parameter in win.loadURL. F.i. https://stackoverflow.com/a/52497939/501082 or https://at15r.medium.com/electron-app-showing-white-screen-after-successful-build-but-work-in-development-mode-7e4f612a0871

I am able to reproduce this case on my Windows VM instance quite often, almost always, but rarely in osx or my host Windows computer.

I looked at main.js for the Host project and the only occurrence of loadURL is for the splash screen. The splash screen shows fine, however then the main window produces no content.

I'm really sweating bullets with this issue.
Does anyone have encountered it or perhaps has some ideas on the issue?

In OSX, I can press the red X button and then restore the app from the background, and the UI is loaded, but on Windows minimizing/restoring from the taskbar does not do anything.

VirtualBox_Windows 10 (64-bit) Home edition_17_04_2024_15_02_14

@nazar322
Copy link
Author

nazar322 commented Apr 23, 2024

Here is the fix!

mainWindow.OnShow += OnMainWindowShown;
mainWindow.OnClosed += OnMainWindowClosed;

private static void OnMainWindowShown()
{
    if (!_windowShownFlag)
        ElectronHelper.MainWindow.Reload();

    _windowShownFlag = true;
}

private static void OnMainWindowClosed()
{
    _windowShownFlag = false;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant