mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: unable to clear preview image on can't get mimetype
This commit is contained in:
parent
c49bf02ca4
commit
a0da57a293
2 changed files with 2 additions and 6 deletions
|
|
@ -18,7 +18,7 @@ impl Manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
let Some(mime) = self.mimetype.get(url).cloned() else {
|
let Some(mime) = self.mimetype.get(url).cloned() else {
|
||||||
return false;
|
return self.active_mut().preview.reset(|_| true);
|
||||||
};
|
};
|
||||||
|
|
||||||
if sequent {
|
if sequent {
|
||||||
|
|
|
||||||
|
|
@ -49,17 +49,13 @@ impl MimeKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn valid(s: &str) -> bool {
|
pub fn valid(s: &str) -> bool {
|
||||||
if s == "inode/x-empty" {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
let parts = s.split('/').collect::<Vec<_>>();
|
let parts = s.split('/').collect::<Vec<_>>();
|
||||||
if parts.len() != 2 {
|
if parts.len() != 2 {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
let b = matches!(parts[0], "application" | "audio" | "example" | "font" | "image" | "message" | "model" | "multipart" | "text" | "video");
|
let b = matches!(parts[0], "application" | "audio" | "example" | "font" | "image" | "inode" | "message" | "model" | "multipart" | "text" | "video");
|
||||||
b && !parts[1].is_empty()
|
b && !parts[1].is_empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue