File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -411,19 +411,18 @@ LoginItemSettings GetLoginItemSettingsDeprecated() {
411
411
#else
412
412
// If the app was previously set as a LoginItem with the deprecated API,
413
413
// we should report its LoginItemSettings via the old API.
414
- LoginItemSettings settings_deprecated = GetLoginItemSettingsDeprecated ();
415
414
if (@available (macOS 13 , *)) {
416
415
const std::string status =
417
416
platform_util::GetLoginItemEnabled (options.type , options.service_name );
418
417
if (status == " enabled-deprecated" ) {
419
- settings = settings_deprecated ;
418
+ settings = GetLoginItemSettingsDeprecated () ;
420
419
} else {
421
420
settings.open_at_login = status == " enabled" ;
422
421
settings.opened_at_login = was_launched_at_login_;
423
422
settings.status = status;
424
423
}
425
424
} else {
426
- settings = settings_deprecated ;
425
+ settings = GetLoginItemSettingsDeprecated () ;
427
426
}
428
427
#endif
429
428
return gin::ConvertToV8 (isolate, settings);
Original file line number Diff line number Diff line change @@ -220,7 +220,6 @@ void Beep() {
220
220
221
221
std::string GetLoginItemEnabled (const std::string& type,
222
222
const std::string& service_name) {
223
- bool enabled = GetLoginItemEnabledDeprecated ();
224
223
if (@available (macOS 13 , *)) {
225
224
SMAppService* service = GetServiceForType (type, service_name);
226
225
SMAppServiceStatus status = [service status ];
@@ -232,10 +231,11 @@ void Beep() {
232
231
return " requires-approval" ;
233
232
else if (status == SMAppServiceStatusNotFound) {
234
233
// If the login item was enabled with the old API, return that.
235
- return enabled ? " enabled-deprecated" : " not-found" ;
234
+ return GetLoginItemEnabledDeprecated () ? " enabled-deprecated"
235
+ : " not-found" ;
236
236
}
237
237
}
238
- return enabled ? " enabled" : " not-registered" ;
238
+ return GetLoginItemEnabledDeprecated () ? " enabled" : " not-registered" ;
239
239
}
240
240
241
241
bool SetLoginItemEnabled (const std::string& type,
You can’t perform that action at this time.
0 commit comments