From f2f2ec9bd26797cdb45303a535a522a8c2edbf87 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 9 Nov 2024 08:08:08 +0200 Subject: [PATCH] enshort cancellable update --- src/app/browser/window/tab/item/page.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index 8764ba38..44da88fa 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -186,16 +186,13 @@ impl Page { // Reset widgets self.input.unset(); - // Cancel previous async loading operations - { - let cancellable = self.cancellable.borrow(); - - if !cancellable.is_cancelled() { - cancellable.cancel(); - } + // Cancel previous async operations + let cancellable = self.cancellable.take(); + if !cancellable.is_cancelled() { + cancellable.cancel(); } - // Create new cancellable pointer + // Create new cancellable self.cancellable.replace(Cancellable::new()); // Create shared variant value