trodi / electron-splashscreen

Simple splashscreen for electron applications.
MIT License
170 stars 29 forks source link

Splash screen won't close itself automatically. #23

Closed Symbolk closed 4 years ago

Symbolk commented 4 years ago

Description

Thanks for this nice project. I tried to integrate the splash screen into my electron-vue app (https://github.com/Symbolk/SmartCommit), but I found that the splash screen won't close itself after the duration time. Can you have a look at this?

Code: https://github.com/Symbolk/SmartCommit/blob/c26819c134f693eb42f0aab9b537b49bab29f276/src/background.js#L131

Environment

Steps to Reproduce

  1. Clone the project and run the following command under the root directory of the cloned repo to install dependencies:

    yarn install
  2. Compiles and hot-reloads for development:

    yarn electron:serve

Expected behaviour

The splash window shows itself and will close itself after 1500ms.

Actual behaviour

The splash window shows itself and won't close automatically.

trodi commented 4 years ago

initSplashScreen takes in its config windowOpts which are used to create a BrowserWindow for your app and returns it. You need to use this BrowserWindow to load your main app (win.loadURL(...)). You aren't doing this. Use the returned BrowserWindow to load your renderer process.

Take a look at the example code to see a working example.

Symbolk commented 4 years ago

initSplashScreen takes in its config windowOpts which are used to create a BrowserWindow for your app and returns it. You need to use this BrowserWindow to load your main app (win.loadURL(...)). You aren't doing this. Use the returned BrowserWindow to load your renderer process.

Take a look at the example code to see a working example.

Thanks for the hint! Now it works like a charm~