From c10134c32e40bcf004ed09799a5fd2a8102e02d9 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 11 Jun 2026 13:15:17 +0800 Subject: [PATCH] fix(comments): convert confirm_with_message Result to Option for WASM compatibility --- src/pages/admin/comments.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/admin/comments.rs b/src/pages/admin/comments.rs index 4010ae7..ddab008 100644 --- a/src/pages/admin/comments.rs +++ b/src/pages/admin/comments.rs @@ -106,7 +106,7 @@ pub fn AdminCommentsPage(page: i32) -> Element { #[cfg(target_arch = "wasm32")] { if web_sys::window() - .and_then(|w| w.confirm_with_message("确定要删除这些评论吗?")) + .and_then(|w| w.confirm_with_message("确定要删除这些评论吗?").ok()) .unwrap_or(false) { let ids: Vec = selected_ids().iter().copied().collect(); @@ -211,7 +211,7 @@ pub fn AdminCommentsPage(page: i32) -> Element { #[cfg(target_arch = "wasm32")] { if web_sys::window() - .and_then(|w| w.confirm_with_message("确定要删除这条评论吗?")) + .and_then(|w| w.confirm_with_message("确定要删除这条评论吗?").ok()) .unwrap_or(false) { let id = id;