Validate action targets; format timestamps client-side; clippy cleanup
Deploy / deploy (push) Successful in 1m0s
Deploy / deploy (push) Successful in 1m0s
- A dangling alternative.action (navigating to "Nothing here") is now a lint/load-time rejection like any other dead reference. - Rows re-rendered after a client-side refetch showed raw milliseconds - format_ms now formats via js_sys::Date under hydrate, matching the server's rendering. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
6932816c42
commit
4d71b6ccd0
+16
-2
@@ -492,7 +492,7 @@ fn AlternativeCard(
|
||||
for feature in &alternative.features {
|
||||
for req in &feature.requirements {
|
||||
if req.kind == "file" {
|
||||
file_refs.entry(req.name.clone()).or_insert_with(NodeRef::new);
|
||||
file_refs.entry(req.name.clone()).or_default();
|
||||
} else if req.kind == "select" {
|
||||
select_field_map
|
||||
.entry(req.name.clone())
|
||||
@@ -1335,7 +1335,21 @@ fn format_ms(ms: i64) -> String {
|
||||
.map(|t| t.format("%Y-%m-%d %H:%M UTC").to_string())
|
||||
.unwrap_or_else(|| ms.to_string())
|
||||
}
|
||||
#[cfg(not(feature = "ssr"))]
|
||||
// Rows re-rendered client-side (a post-confirm refetch) format
|
||||
// here, not on the server - raw milliseconds would show otherwise.
|
||||
#[cfg(all(not(feature = "ssr"), feature = "hydrate"))]
|
||||
{
|
||||
let date = js_sys::Date::new(&wasm_bindgen::JsValue::from_f64(ms as f64));
|
||||
format!(
|
||||
"{:04}-{:02}-{:02} {:02}:{:02} UTC",
|
||||
date.get_utc_full_year(),
|
||||
date.get_utc_month() + 1,
|
||||
date.get_utc_date(),
|
||||
date.get_utc_hours(),
|
||||
date.get_utc_minutes(),
|
||||
)
|
||||
}
|
||||
#[cfg(all(not(feature = "ssr"), not(feature = "hydrate")))]
|
||||
{
|
||||
ms.to_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user