Initial commit

This commit is contained in:
Bnyro
2023-06-18 16:53:53 +02:00
commit 6b8eae051e
25 changed files with 3959 additions and 0 deletions

14
src/util.rs Normal file
View 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("") }
}