armcord/src/themeManager
Ritiek Malhotra d9d24d9473
Improve multi-instance behaviour (#604)
* Experiment with two windows

* Improve multi-instance behaviour

Previously, ArmCord would attempt to launch up a completely new
instance each time when multi-instances setting were enabled. This
doesn't work well as Electron doesn't support running multiple instances
of the same app pointing to the same user data directory
(which by default on GNU/Linux is `~/.config/ArmCord`). Doing so would
result in this error:
> Failed to open LevelDB database" "file currently in use"

It's possible to workaround this behaviour by passing in a parameter to
a different user data directory when launching subsequent instances of
armcord, like so:
```shell
$ armcord --user-data-directory=$HOME/.config/ArmCord-2
```

However, this method ends up taking disk storage in the multiples of the
number of armcord instances that are simultaneously running, which isn't
ideal.

Looking into this more, it looks like Electron can do multiple windows
fine with the same user data directory. I gave this a try and it seems
to be working nice. With this PR, running any subsequent instances of
armcord will open up a new window in the original armcord instance. This
should also help with better resource utilization when compared to
running multiple full blown instances of armcord.

* Fix lints
2024-06-15 10:20:44 +02:00
..
main.ts Improve multi-instance behaviour (#604) 2024-06-15 10:20:44 +02:00
manager.html Updates and Linting (#578) 2024-06-14 14:57:34 +02:00
preload.mts Updates and Linting (#578) 2024-06-14 14:57:34 +02:00