endlessm / endless-key-app

Endless Key app for Windows (formerly known as kolibri-app)
https://www.endlessos.org/key
MIT License
2 stars 1 forks source link

electron: Pass the selected package from WelcomeWrapper to electron process #104

Closed starnight closed 1 year ago

starnight commented 1 year ago

Here is already the function to get the selected package ID from WelcomeWrapper within the contextBridge mechanism which exposes "load" data to the electron main process.

However, it only passes using Kolibri data in the USB storage, or not originally. This patch passes the selected package ID, too. So, electron can tell Kolibri use the correct package by setting the environment variable KOLIBRI_INITIAL_CONTENT_PACK, instead of always the default explorer.

After downloaded the package and restart kolibri-electron.exe, simply passes an empty string as the packId argument of loadKolibriEnv function. It will use what it has in the filesystem which is the content in the USB storage, or the downloaded package.

https://phabricator.endlessm.com/T34742