made collapse only availible when shared

This commit is contained in:
2026-03-20 16:33:32 -05:00
parent a0c67e745d
commit 8077942e24
+3 -1
View File
@@ -905,9 +905,11 @@ export const dismissTaskUpdateIndicator = (taskId: string, updatedAt: string) =>
export const isTaskCollaborativelyShared = (task: Task) => export const isTaskCollaborativelyShared = (task: Task) =>
task.shareRefs.some(ref => { task.shareRefs.some(ref => {
const currentUserId = pb.authStore.model?.id;
const context = getContextByRef(ref); const context = getContextByRef(ref);
const policy = context?.policy || (ref.kind === "user" ? "collaborative" : "handoff"); const policy = context?.policy || (ref.kind === "user" ? "collaborative" : "handoff");
return policy === "collaborative"; const targetUserId = context?.targetUserId || null;
return ref.kind === "user" && policy === "collaborative" && !!targetUserId && targetUserId !== currentUserId;
}); });
export const isTaskCollapsedUntilUpdated = (task: Task) => export const isTaskCollapsedUntilUpdated = (task: Task) =>