Skip to content

Commit

Permalink
Merge pull request #1978 from kjyv/master
Browse files Browse the repository at this point in the history
Poll for updates when waking up from sleep state (macOS)
  • Loading branch information
hbons authored Sep 18, 2021
2 parents 631f563 + 5ee0fe0 commit 85f3d44
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions SparkleShare/Mac/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ public Controller (Configuration config)
Path.Combine (GitCommand.ExecPath, "git-lfs"),
Path.Combine (Config.BinPath, "git-lfs"),
overwite);

NSWorkspace.Notifications.ObserveDidWake((object sender, NSNotificationEventArgs e) => {
Console.Write ("Detected wake from sleep, checking for updates\n");
if (SparkleShare.Controller.RepositoriesLoaded) {
foreach (var repo in SparkleShare.Controller.Repositories) {
repo.SyncDown();
repo.SyncUp();
}
}
});
}


Expand Down

0 comments on commit 85f3d44

Please sign in to comment.