Compare commits
2 Commits
a0c67e745d
...
5a3cf8cde3
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a3cf8cde3 | |||
| 8077942e24 |
+9
-2
@@ -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) =>
|
||||||
@@ -2576,6 +2578,8 @@ export const updateTask = async (id: string, updates: Partial<Task>) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (currentTask) {
|
if (currentTask) {
|
||||||
|
let favoriteTagOverride: string | null | undefined;
|
||||||
|
|
||||||
if (finalUpdates.tags) {
|
if (finalUpdates.tags) {
|
||||||
const parsedTags = parseTags(finalUpdates.tags);
|
const parsedTags = parseTags(finalUpdates.tags);
|
||||||
finalUpdates.labelTags = parsedTags.filter(tag => tag.kind === "label").map(tag => tag.display);
|
finalUpdates.labelTags = parsedTags.filter(tag => tag.kind === "label").map(tag => tag.display);
|
||||||
@@ -2598,10 +2602,13 @@ export const updateTask = async (id: string, updates: Partial<Task>) => {
|
|||||||
key: tag.key
|
key: tag.key
|
||||||
} satisfies NoteRef;
|
} satisfies NoteRef;
|
||||||
});
|
});
|
||||||
|
favoriteTagOverride = finalUpdates.tags.find(tag => tag.endsWith("_favorite__")) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (finalUpdates.labelTags || finalUpdates.shareRefs || finalUpdates.noteRefs) {
|
if (finalUpdates.labelTags || finalUpdates.shareRefs || finalUpdates.noteRefs) {
|
||||||
const favoriteTag = currentTask.tags.find(tag => tag.endsWith("_favorite__"));
|
const favoriteTag = favoriteTagOverride !== undefined
|
||||||
|
? favoriteTagOverride || undefined
|
||||||
|
: currentTask.tags.find(tag => tag.endsWith("_favorite__"));
|
||||||
finalUpdates.tags = buildTaskTags(
|
finalUpdates.tags = buildTaskTags(
|
||||||
finalUpdates.labelTags || currentTask.labelTags,
|
finalUpdates.labelTags || currentTask.labelTags,
|
||||||
finalUpdates.shareRefs || currentTask.shareRefs,
|
finalUpdates.shareRefs || currentTask.shareRefs,
|
||||||
|
|||||||
Reference in New Issue
Block a user