feat: harden file sharing and integrity
This commit is contained in:
@@ -1024,7 +1024,14 @@ renderPatternPreview?: FilesManagedFileChooserProps["renderPatternPreview"])
|
||||
|
||||
function isLinkedToTarget(file: ManagedFile, target?: FilesManagedFileLinkTarget): boolean {
|
||||
if (!target) return false;
|
||||
return Boolean(file.shares?.some((share) => share.target_type === target.type && share.target_id === target.id && !share.revoked_at));
|
||||
return Boolean(file.shares?.some((share) =>
|
||||
share.target_type === target.type
|
||||
&& share.target_id === target.id
|
||||
&& (typeof share.active === "boolean"
|
||||
? share.active
|
||||
: !share.revoked_at
|
||||
&& (!share.expires_at || new Date(share.expires_at).getTime() > Date.now()))
|
||||
));
|
||||
}
|
||||
|
||||
function readRememberedState(key: string): RememberedChooserState {
|
||||
|
||||
Reference in New Issue
Block a user