pinakes-ui: integrate plugin pages into sidebar navigation; sanitize theme-extension CSS eval
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ie87e39c66253a7071f029d52dd5979716a6a6964
This commit is contained in:
parent
bea42524f2
commit
24b31bfeb9
1 changed files with 7 additions and 16 deletions
|
|
@ -369,11 +369,13 @@ pub fn App() -> Element {
|
|||
spawn(async move {
|
||||
let js: String = vars
|
||||
.iter()
|
||||
.map(|(k, v)| {
|
||||
format!(
|
||||
"document.documentElement.style.setProperty('{}','{}');",
|
||||
k, v
|
||||
)
|
||||
.filter_map(|(k, v)| {
|
||||
let k_js = serde_json::to_string(k).ok()?;
|
||||
let v_js = serde_json::to_string(v).ok()?;
|
||||
Some(format!(
|
||||
"document.documentElement.style.setProperty({k_js},\
|
||||
{v_js});"
|
||||
))
|
||||
})
|
||||
.collect();
|
||||
let _ = document::eval(&js).await;
|
||||
|
|
@ -849,17 +851,6 @@ pub fn App() -> Element {
|
|||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
let sync_time_opt = plugin_registry
|
||||
.read()
|
||||
.last_refresh()
|
||||
.map(|ts| ts.format("%H:%M").to_string());
|
||||
rsx! {
|
||||
if let Some(sync_time) = sync_time_opt {
|
||||
div { class: "nav-sync-time", "Synced {sync_time}" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue