🌐 AI搜索 & 代理 主页
Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
safely unwrap context notification
  • Loading branch information
chillenberger committed Jun 17, 2024
commit 23fb688e49ad8d2633c388e9b86dc85a4630b8d2
6 changes: 2 additions & 4 deletions pgml-dashboard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,10 @@ pub fn replace_banner_product(

Notifications::update_viewed(&all_notification_cookies, cookies);

// Get the notification that triggered this call..
// unwrap notifications if fine since we should panic if this is missing.
let last_notification = context
let last_notification: Option<Notification> = context
.notifications
.as_ref()
.unwrap()
.unwrap_or(&vec![] as &Vec<Notification>)
.clone()
.into_iter()
.find(|n: &Notification| -> bool { n.id == id });
Expand Down