Compare commits

...

2 Commits

Author SHA1 Message Date
tcardoza 5a3cf8cde3 fixed starring tasks
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m3s
2026-03-20 16:36:06 -05:00
tcardoza 8077942e24 made collapse only availible when shared 2026-03-20 16:33:32 -05:00
+9 -2
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) =>
@@ -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,