@@ -42,6 +42,7 @@ const autoLauncher = new AutoLaunch({
42
42
} ) ;
43
43
44
44
const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions' ;
45
+ const CATALINA_AUDIO_HACK_KEY = '_temp_askedForCatalinaAudioPermissions' ;
45
46
46
47
export default class AppStore extends Store {
47
48
updateStatusTypes = {
@@ -185,8 +186,6 @@ export default class AppStore extends Store {
185
186
186
187
this . _healthCheck ( ) ;
187
188
188
- console . log ( nativeTheme ) ;
189
-
190
189
this . isSystemDarkModeEnabled = nativeTheme . shouldUseDarkColors ;
191
190
192
191
onVisibilityChange ( ( isVisible ) => {
@@ -223,13 +222,23 @@ export default class AppStore extends Store {
223
222
// macOS catalina notifications hack
224
223
// notifications got stuck after upgrade but forcing a notification
225
224
// via `new Notification` triggered the permission request
226
- if ( isMac && ! localStorage . getItem ( CATALINA_NOTIFICATION_HACK_KEY ) ) {
227
- // eslint-disable-next-line no-new
228
- new window . Notification ( 'Welcome to Franz 5' , {
229
- body : 'Have a wonderful day & happy messaging.' ,
230
- } ) ;
225
+ if ( isMac ) {
226
+ if ( ! localStorage . getItem ( CATALINA_NOTIFICATION_HACK_KEY ) ) {
227
+ // eslint-disable-next-line no-new
228
+ new window . Notification ( 'Welcome to Franz 5' , {
229
+ body : 'Have a wonderful day & happy messaging.' ,
230
+ } ) ;
231
231
232
- localStorage . setItem ( CATALINA_NOTIFICATION_HACK_KEY , true ) ;
232
+ localStorage . setItem ( CATALINA_NOTIFICATION_HACK_KEY , true ) ;
233
+ }
234
+
235
+ if ( ! localStorage . getItem ( CATALINA_AUDIO_HACK_KEY ) ) {
236
+ // eslint-disable-next-line no-new
237
+ const stream = await navigator . mediaDevices . getUserMedia ( { audio : true , video : true } ) ;
238
+ stream . getTracks ( ) . forEach ( track => track . stop ( ) ) ;
239
+
240
+ localStorage . setItem ( CATALINA_AUDIO_HACK_KEY , true ) ;
241
+ }
233
242
}
234
243
235
244
statsEvent ( 'app-start' ) ;
0 commit comments