in-web: expired share links no longer suppress the create form
Browse files at this commitf31aab3926b197c1be5f3b6d219369b47c55a07fParent: 62387971 changed file +6 -1
crates/in-web/src/share.rsmodified+6 -1
| @@ -1621,7 +1621,12 @@ pub(crate) async fn share_modal<'a>( | |||
| 1621 | let live: Vec<_> = links | 1621 | let live: Vec<_> = links |
| 1622 | .into_iter() | 1622 | .into_iter() |
| 1623 | .filter(|link| { | 1623 | .filter(|link| { |
| 1624 | - link.kind == kind && link.target_id == target_id && link.revoked_at.is_none() | 1624 | + // An expired link is as dead as a revoked one for form purposes: |
| 1625 | + // it must not suppress the create form. | ||
| 1626 | + link.kind == kind | ||
| 1627 | + && link.target_id == target_id | ||
| 1628 | + && link.revoked_at.is_none() | ||
| 1629 | + && link.expires_at.is_none_or(|at| at > OffsetDateTime::now_utc()) | ||
| 1625 | }) | 1630 | }) |
| 1626 | .collect(); | 1631 | .collect(); |
| 1627 | let grants = match store.shares_for_target(&user.id, kind, target_id).await { | 1632 | let grants = match store.shares_for_target(&user.id, kind, target_id).await { |