fix: images are not completely cleared occasionally

This commit is contained in:
sxyazi 2023-08-27 08:28:59 +08:00
parent e4096c0f25
commit a36dabfe85
No known key found for this signature in database
2 changed files with 10 additions and 11 deletions

16
Cargo.lock generated
View file

@ -177,9 +177,9 @@ dependencies = [
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.21.2" version = "0.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53"
[[package]] [[package]]
name = "bincode" name = "bincode"
@ -1465,9 +1465,9 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.9.3" version = "1.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -1477,9 +1477,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.3.6" version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -1488,9 +1488,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.7.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"

View file

@ -24,9 +24,8 @@ impl Adaptor {
path = cache.as_path(); path = cache.as_path();
} }
if IMAGE_SHOWN.swap(true, Ordering::Relaxed) { Self::image_hide(rect).ok();
Self::image_hide(rect).ok(); IMAGE_SHOWN.store(true, Ordering::Relaxed);
}
match PREVIEW.adaptor { match PREVIEW.adaptor {
PreviewAdaptor::Kitty => Kitty::image_show(path, rect).await, PreviewAdaptor::Kitty => Kitty::image_show(path, rect).await,