tangled
alpha
login
or
join now
j0.lol
/
bl0ck
0
fork
atom
WebGPU Voxel Game
0
fork
atom
overview
issues
4
pulls
pipelines
Web addressing bugfix
j0.lol
1 year ago
4e8d369c
1379a8c1
+8
-6
1 changed file
expand all
collapse all
unified
split
src
resources.rs
+8
-6
src/resources.rs
···
8
8
fn format_url(file_name: &str) -> reqwest::Url {
9
9
let window = web_sys::window().unwrap();
10
10
let location = window.location();
11
11
-
let mut origin = location.origin().unwrap();
12
12
-
if !origin.ends_with("res") {
13
13
-
origin = format!("{}/res", origin);
14
14
-
}
15
15
-
let base = reqwest::Url::parse(&format!("{}/", origin)).unwrap();
16
16
-
base.join(file_name).unwrap()
11
11
+
// let mut origin = location.pathname().unwrap();
12
12
+
// if !origin.ends_with("res") {
13
13
+
// origin = format!("{}/res", origin);
14
14
+
// }
15
15
+
// let base = reqwest::Url::parse(&format!("{}/", origin)).unwrap();
16
16
+
// base.join(file_name).unwrap()
17
17
+
18
18
+
reqwest::Url::parse(&format!("{}/../res/{}",location.href().unwrap(), file_name)).unwrap()
17
19
}
18
20
19
21
pub async fn load_string(file_name: &str) -> Result<String, Box<dyn Error>> {