From 615dc7bb928d306bd5dededb62c0a88ba1545b1d Mon Sep 17 00:00:00 2001 From: Noe Date: Tue, 23 Jul 2024 15:00:51 +0200 Subject: [PATCH] If testing mode is enabled and action gets deleted, inform all connected installations --- csharp/App/Backend/DataTypes/Methods/Session.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/csharp/App/Backend/DataTypes/Methods/Session.cs b/csharp/App/Backend/DataTypes/Methods/Session.cs index c0c49c79a..0d622fa7a 100644 --- a/csharp/App/Backend/DataTypes/Methods/Session.cs +++ b/csharp/App/Backend/DataTypes/Methods/Session.cs @@ -176,7 +176,13 @@ public static class SessionMethods if (user is null || user.UserType == 0) return false; var action = Db.GetActionById(actionId); - + if (action.TestingMode) + { + var installation = Db.GetInstallationById(action.InstallationId); + installation.TestingMode = false; + installation.Apply(Db.Update); + WebsocketManager.InformWebsocketsForInstallation(action.InstallationId); + } Db.Delete(action); Console.WriteLine("---------------Deleted the Action in the database-----------------");