Skip to content

Commit 5359f9b

Browse files
committed
Hide camera toggle toast for camera init #4782
1 parent 04a25a4 commit 5359f9b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/Input/InputDispatcher.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,21 +1154,21 @@ public static void ToggleCamera()
11541154
}
11551155
}
11561156

1157-
private static void SetCamera(int status)
1157+
private static void SetCamera(int status, bool toast = true)
11581158
{
11591159
string asusPath = GetAsusPath();
11601160

11611161
var cameraStatus = AppConfig.Get("camera_status");
11621162
if (status == 2) status = cameraStatus > 0 ? 0 : 1;
1163-
var result = ProcessHelper.RunCMD($"{asusPath}\\AsusHotkey.exe", $"-MFCameraCommand {status} 1 0", asusPath);
1164-
Program.toast.RunToast($"Camera " + ((status == 1) ? "On" : "Off"));
1163+
ProcessHelper.RunCMD($"{asusPath}\\AsusHotkey.exe", $"-MFCameraCommand {status} 1 0", asusPath);
1164+
if (toast) Program.toast.RunToast($"Camera " + ((status == 1) ? "On" : "Off"));
11651165
AppConfig.Set("camera_status", status);
11661166
}
11671167

11681168
private static void InitCamera()
11691169
{
11701170
var cameraStatus = AppConfig.Get("camera_status");
1171-
if (cameraStatus >= 0) SetCamera(cameraStatus);
1171+
if (cameraStatus >= 0) SetCamera(cameraStatus, false);
11721172
}
11731173

11741174
private static System.Threading.Timer screenpadActionTimer;

0 commit comments

Comments
 (0)