fix(core): fallback to `{asset}/index.html` before `index.html`, closes #2328 (#2329)

This commit is contained in:
Amr Bashir 2021-08-02 04:46:13 +02:00 committed by GitHub
parent cf9f6aa148
commit d22da650ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Assets will now fallback to `<uri>/index.html` before `/index.html`, allowing anchor links to work as expected.

View File

@ -353,6 +353,7 @@ impl<R: Runtime> WindowManager<R> {
let asset_response = assets
.get(&path.as_str().into())
.or_else(|| assets.get(&format!("{}/index.html", path.as_str()).into()))
.or_else(|| {
#[cfg(debug_assertions)]
eprintln!("Asset `{}` not found; fallback to index.html", path); // TODO log::error!