Skip to content

Commit

Permalink
fix login item activation/deactivation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepistrol committed Oct 4, 2024
1 parent 7fbf66a commit 2ccaad0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions TimeMachineStatus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
2808509E2CB0070E00880CE4 /* TimeMachineStatusHelper.app in Copy Helper */ = {isa = PBXBuildFile; fileRef = 28710D312CAFE3CE00033855 /* TimeMachineStatusHelper.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
280AF0D32CAC4B2C000B389B /* PreferencesFileImporterViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 280AF0D22CAC4B2C000B389B /* PreferencesFileImporterViewModifier.swift */; };
280AF0D52CAD33A1000B389B /* VisualEffectBackgroundViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 280AF0D42CAD33A1000B389B /* VisualEffectBackgroundViewModifier.swift */; };
280AF0D72CAD33D4000B389B /* HideWindowControlsViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 280AF0D62CAD33D4000B389B /* HideWindowControlsViewModifier.swift */; };
Expand Down Expand Up @@ -71,6 +72,7 @@
dstPath = Contents/Library/LoginItems;
dstSubfolderSpec = 1;
files = (
2808509E2CB0070E00880CE4 /* TimeMachineStatusHelper.app in Copy Helper */,
);
name = "Copy Helper";
runOnlyForDeploymentPostprocessing = 0;
Expand Down
4 changes: 2 additions & 2 deletions TimeMachineStatus/ViewModel/LaunchItemProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class LaunchItemProvider: ObservableObject {
try launchItem.register()
} catch {
log.error("Failed to register login item: \(error)")
launchAtLogin = false
launchAtLogin = launchItem.status == .enabled
}
}

Expand All @@ -55,7 +55,7 @@ class LaunchItemProvider: ObservableObject {
try launchItem.unregister()
} catch {
log.error("Failed to unregister login item: \(error)")
launchAtLogin = true
launchAtLogin = launchItem.status == .enabled
}
}
}

0 comments on commit 2ccaad0

Please sign in to comment.