Fix MacOS crashing on launch (#132)

This commit is contained in:
Syer10 2021-06-05 14:06:36 -04:00 committed by GitHub
parent 8f09ebacf5
commit c96da79058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,10 @@ object SystemTray {
CacheUtil.clear(BuildConfig.NAME) CacheUtil.clear(BuildConfig.NAME)
if (System.getProperty("os.name").startsWith("Mac")) {
SystemTray.FORCE_TRAY_TYPE = SystemTray.TrayType.Awt
}
val systemTray = SystemTray.get(BuildConfig.NAME) ?: return null val systemTray = SystemTray.get(BuildConfig.NAME) ?: return null
val mainMenu = systemTray.menu val mainMenu = systemTray.menu