Initial commit
This commit is contained in:
14
src/util.rs
Normal file
14
src/util.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use lemmy_api_common::lemmy_db_schema::newtypes::DbUrl;
|
||||
use relm4_components::web_image::WebImageMsg;
|
||||
|
||||
pub fn get_web_image_msg(url: Option<DbUrl>) -> WebImageMsg {
|
||||
return if let Some(url) = url {
|
||||
WebImageMsg::LoadImage(url.to_string())
|
||||
} else { WebImageMsg::Unload };
|
||||
}
|
||||
|
||||
pub fn get_web_image_url(url: Option<DbUrl>) -> String {
|
||||
return if let Some(url) = url {
|
||||
url.to_string()
|
||||
} else { String::from("") }
|
||||
}
|
||||
Reference in New Issue
Block a user