From c0e67d626242ee9a2011fe32e7b349df1243ef1e Mon Sep 17 00:00:00 2001 From: FlorianDahn Date: Fri, 27 Jan 2023 20:11:45 +0100 Subject: [PATCH] Fixing AutoCleanForm and NavigationController - AutoCleanForm does not work properly inside a NavigationController (Some messages wont get deleted) --- TelegramBotBase/Form/Navigation/NavigationController.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TelegramBotBase/Form/Navigation/NavigationController.cs b/TelegramBotBase/Form/Navigation/NavigationController.cs index d1858b9..3f4c927 100644 --- a/TelegramBotBase/Form/Navigation/NavigationController.cs +++ b/TelegramBotBase/Form/Navigation/NavigationController.cs @@ -134,6 +134,9 @@ namespace TelegramBotBase.Form.Navigation /// public virtual async Task PushAsync(FormBase form, params object[] args) { + //Leave current form (needed for AutoCleanForm to work properly) + await CurrentForm.OnClosed(new EventArgs()); + form.Client = this.Client; form.Device = this.Device; form.NavigationController = this;