From b7dfd66ad6ae0c2ad5deaa2ea8d953d687d09d23 Mon Sep 17 00:00:00 2001 From: Salihu Date: Thu, 23 Jul 2026 22:27:56 +0100 Subject: [PATCH] fix bug --- app/components/Sharing/Collection/PublicAccess.tsx | 2 +- app/components/Sharing/Document/PublicAccess.tsx | 4 ++-- app/scenes/Collection/components/ShareButton.tsx | 2 +- app/scenes/Document/components/ShareButton.tsx | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/components/Sharing/Collection/PublicAccess.tsx b/app/components/Sharing/Collection/PublicAccess.tsx index 892d1342c3..bbaae134ac 100644 --- a/app/components/Sharing/Collection/PublicAccess.tsx +++ b/app/components/Sharing/Collection/PublicAccess.tsx @@ -50,7 +50,7 @@ function InnerPublicAccess( const collectionAbilities = usePolicy(collection); const canPublish = share ? can.update : collectionAbilities.share; const [creating, setCreating] = React.useState(false); - const isShareExpired = share?.expiresAt && isTodayOrAfter(share.expiresAt); + const isShareExpired = share?.expiresAt && !isTodayOrAfter(share.expiresAt); React.useEffect(() => { setUrlId(share?.urlId); diff --git a/app/components/Sharing/Document/PublicAccess.tsx b/app/components/Sharing/Document/PublicAccess.tsx index baf8561e4d..da5f094f41 100644 --- a/app/components/Sharing/Document/PublicAccess.tsx +++ b/app/components/Sharing/Document/PublicAccess.tsx @@ -59,9 +59,9 @@ function PublicAccess( const documentAbilities = usePolicy(document); const canPublish = share ? can.update : documentAbilities.share; const [creating, setCreating] = React.useState(false); - const isShareExpired = share?.expiresAt && isTodayOrAfter(share.expiresAt); + const isShareExpired = share?.expiresAt && !isTodayOrAfter(share.expiresAt); const isParentShareExpired = - sharedParent?.expiresAt && isTodayOrAfter(sharedParent.expiresAt); + sharedParent?.expiresAt && !isTodayOrAfter(sharedParent.expiresAt); const hasExpiredShare = (!!share?.published && isShareExpired) || diff --git a/app/scenes/Collection/components/ShareButton.tsx b/app/scenes/Collection/components/ShareButton.tsx index f1158e5357..b2b8f56dfd 100644 --- a/app/scenes/Collection/components/ShareButton.tsx +++ b/app/scenes/Collection/components/ShareButton.tsx @@ -33,7 +33,7 @@ function ShareButton({ collection }: Props) { const isMobile = useMobile(); const team = useCurrentTeam(); const share = shares.getByCollectionId(collection.id); - const isShareExpired = share?.expiresAt && isTodayOrAfter(share.expiresAt); + const isShareExpired = share?.expiresAt && !isTodayOrAfter(share.expiresAt); const isPubliclyShared = team.sharing !== false && collection?.sharing !== false && diff --git a/app/scenes/Document/components/ShareButton.tsx b/app/scenes/Document/components/ShareButton.tsx index 07fd44257f..21c6c524db 100644 --- a/app/scenes/Document/components/ShareButton.tsx +++ b/app/scenes/Document/components/ShareButton.tsx @@ -33,9 +33,9 @@ function ShareButton({ document }: Props) { const share = shares.getByDocumentId(document.id); const sharedParent = shares.getByDocumentParents(document); const domain = share?.domain || sharedParent?.domain; - const isShareExpired = share?.expiresAt && isTodayOrAfter(share.expiresAt); + const isShareExpired = share?.expiresAt && !isTodayOrAfter(share.expiresAt); const isParentShareExpired = - sharedParent?.expiresAt && isTodayOrAfter(sharedParent.expiresAt); + sharedParent?.expiresAt && !isTodayOrAfter(sharedParent.expiresAt); const hasActiveShare = !!share?.published && !isShareExpired; const hasActiveParentShare = !!sharedParent?.published && !isParentShareExpired;