diff --git a/Ticky.Web/Components/Dialogs/EditCardModal.razor b/Ticky.Web/Components/Dialogs/EditCardModal.razor index a095005..7f727aa 100644 --- a/Ticky.Web/Components/Dialogs/EditCardModal.razor +++ b/Ticky.Web/Components/Dialogs/EditCardModal.razor @@ -513,11 +513,20 @@ public override void Dispose() { - if (_pasteObjRef is null) - return; + if (_pasteObjRef is not null) + { + _pasteObjRef.Dispose(); + _pasteObjRef = null; + } + + if (_timer is not null) + { + _timer.Stop(); + _timer.Dispose(); + _timer = null; + } - _pasteObjRef.Dispose(); - _pasteObjRef = null; + base.Dispose(); } private async Task CopyDeepLink() @@ -592,12 +601,22 @@ if(_card is null || targetRecord is null) { if (_timer is not null) + { _timer.Stop(); + _timer.Dispose(); + } + return; } _ongoingTimer = DateTime.Now - targetRecord.StartedAt; StateHasChanged(); + + if (_timer is not null) + { + _timer.Stop(); + _timer.Dispose(); + } _timer = new System.Timers.Timer(1000); _timer.Elapsed += OnTimerTick;