mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
fix bug
This commit is contained in:
1 parent
5e8d75170d
commit
b7dfd66ad6
4 files changed
+6
-6
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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) ||
|
||||
|
||||
@@ -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 &&
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user