Fix the base path in desktop builds (#3949)
* Fix the base path in desktop builds --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
0c0f0e96df
commit
be01cf1485
4 files changed
+638
-545
No files matched your search
@@ -98,22 +98,6 @@ pub(crate) struct WebAppConfig {
|
||||
pub(crate) base_path: Option<String>,
|
||||
}
|
||||
|
||||
impl WebAppConfig {
|
||||
/// Get the normalized base path for the application with `/` trimmed from both ends. If the base path is not set, this will return `.`.
|
||||
pub(crate) fn base_path(&self) -> &str {
|
||||
let trimmed_path = self
|
||||
.base_path
|
||||
.as_deref()
|
||||
.unwrap_or_default()
|
||||
.trim_matches('/');
|
||||
if trimmed_path.is_empty() {
|
||||
"."
|
||||
} else {
|
||||
trimmed_path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for WebAppConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
||||
Reference in new issue
Block a user