Skip to content

Commit

Permalink
image loading fucked up 4 some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
marci1175 committed Dec 24, 2023
1 parent 97d7ae6 commit 1208113
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/account_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ pub fn write_image(file_response: ServerImageReply, ip: String) -> Result<()> {
//secondly create the folder labeled with the specified server ip

let path = format!(
"{}\\szeChat\\Client\\{}\\{}",
"{}\\szeChat\\Client\\{}\\Images\\{}",
env!("APPDATA"),
general_purpose::URL_SAFE_NO_PAD.encode(&ip),
file_response.index
Expand Down
7 changes: 6 additions & 1 deletion src/app/ui/client_ui/message_instances/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ impl TemplateApp {
}
Err(_err) => {
//create decoy file, to manually create a race condition
let _ = fs::create_dir_all(path.clone());
let _ = fs::create_dir_all(PathBuf::from(format!(
"{}\\szeChat\\Client\\{}\\Images",
env!("APPDATA"),
self.send_on_ip_base64_encoded,
)));

if let Err(err) = std::fs::write(
path,
"This is a placeholder file, this will get overwritten (hopefully)",
Expand Down

0 comments on commit 1208113

Please sign in to comment.