fix: restore wasOpenedAtLogin functionality (#42411)

fix: restore opened at login functionality
This commit is contained in:
Shelley Vohr 2024-06-10 09:39:56 -05:00 committed by GitHub
parent c3b4cd987c
commit 91205540c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 1 deletions

View file

@ -84,6 +84,14 @@ static NSDictionary* UNNotificationResponseToNSDictionary(
}
}
NSAppleEventDescriptor* event =
NSAppleEventManager.sharedAppleEventManager.currentAppleEvent;
BOOL launched_as_login_item =
(event.eventID == kAEOpenApplication &&
[event paramDescriptorForKeyword:keyAEPropData].enumCodeValue ==
keyAELaunchedAsLogInItem);
electron::Browser::Get()->SetLaunchedAtLogin(launched_as_login_item);
electron::Browser::Get()->DidFinishLaunching(
electron::NSDictionaryToValue(notification_info));
}