Fixed sending domain info with "'" to UI.

This commit is contained in:
Revertron
2021-09-22 11:52:56 +02:00
parent 522a75d511
commit 2f577c6665
3 changed files with 3 additions and 2 deletions
Generated
+1 -1
View File
@@ -78,7 +78,7 @@ dependencies = [
[[package]] [[package]]
name = "alfis" name = "alfis"
version = "0.6.8" version = "0.6.9"
dependencies = [ dependencies = [
"base64", "base64",
"bincode", "bincode",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "alfis" name = "alfis"
version = "0.6.8" version = "0.6.9"
authors = ["Revertron <alfis@revertron.com>"] authors = ["Revertron <alfis@revertron.com>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+1
View File
@@ -359,6 +359,7 @@ fn load_domains(context: &mut MutexGuard<Context>, handle: &Handle<()>) {
//debug!("Domains: {:?}", &domains.values()); //debug!("Domains: {:?}", &domains.values());
for (_identity, (domain, timestamp, data)) in domains { for (_identity, (domain, timestamp, data)) in domains {
let d = serde_json::to_string(&data).unwrap(); let d = serde_json::to_string(&data).unwrap();
let d = d.replace("'", "\\'");
let command = format!("addMyDomain('{}', {}, {}, '{}');", &domain, timestamp, timestamp + DOMAIN_LIFETIME, &d); let command = format!("addMyDomain('{}', {}, {}, '{}');", &domain, timestamp, timestamp + DOMAIN_LIFETIME, &d);
let _ = handle.dispatch(move |web_view|{ let _ = handle.dispatch(move |web_view|{
web_view.eval(&command) web_view.eval(&command)