Fixing AutoCleanForm and NavigationController

- AutoCleanForm does not work properly inside a NavigationController (Some messages wont get deleted)
This commit is contained in:
FlorianDahn 2023-01-27 20:11:45 +01:00
parent 34890e35ac
commit c0e67d6262

View File

@ -134,6 +134,9 @@ namespace TelegramBotBase.Form.Navigation
/// <returns></returns>
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;