mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-23 08:32:51 +00:00
fix: windows systems not loading using screenshots://
This commit is contained in:
@@ -1663,7 +1663,12 @@ pub fn run() {
|
|||||||
.register_uri_scheme_protocol("screenshots", |_app, request| {
|
.register_uri_scheme_protocol("screenshots", |_app, request| {
|
||||||
let uri = request.uri().path();
|
let uri = request.uri().path();
|
||||||
let decoded_path = percent_encoding::percent_decode_str(uri).decode_utf8_lossy();
|
let decoded_path = percent_encoding::percent_decode_str(uri).decode_utf8_lossy();
|
||||||
let path = std::path::Path::new(&*decoded_path);
|
let mut path_str = decoded_path.to_string();
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
if path_str.starts_with('/') {
|
||||||
|
path_str = path_str[1..].to_string();
|
||||||
|
}
|
||||||
|
let path = std::path::Path::new(&path_str);
|
||||||
|
|
||||||
match std::fs::read(path) {
|
match std::fs::read(path) {
|
||||||
Ok(data) => {
|
Ok(data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user