Skip to content

Commit

Permalink
Fix Awake v1 & v2
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthoDingo committed Aug 27, 2024
1 parent f4603d7 commit 27a1052
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion System/Computer/Awake/Awake.v1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ public static void SetIndefiniteKeepAwake(bool keepDisplayOn = false)
/// <param name="callback"></param>
/// <param name="failureCallback"></param>
/// <param name="keepDisplayOn"></param>
public static void SetIndefiniteKeepAwake(Action<bool>? callback, Action? failureCallback, bool keepDisplayOn = false)
public static void SetIndefiniteKeepAwake(Action<bool> callback, Action? failureCallback, bool keepDisplayOn = false)
{
_cts.Cancel();

callback ??= (bool success) => { };
failureCallback ??= () => { };

try
{
if (_runnerThread != null && !_runnerThread.IsCanceled)
Expand Down
1 change: 1 addition & 0 deletions System/Computer/Awake/Awake.v2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ static Awake()
{
_log = LogManager.GetCurrentClassLogger();
_cts = new CancellationTokenSource();
_stateQueue = [];
StartMonitor();
}

Expand Down
6 changes: 3 additions & 3 deletions System/System.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<Company>FrenchyApps42</Company>
<PackageIcon>logo.png</PackageIcon>
<Version>1.0.2</Version>
<AssemblyVersion>1.0.2</AssemblyVersion>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0</AssemblyVersion>
<PackageReleaseNotes>Implement Awake from Microsoft Powertoys</PackageReleaseNotes>
<FileVersion>1.0.2.1</FileVersion>
<FileVersion>1.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 27a1052

Please sign in to comment.