visibility fix for user's own tags
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
VITE_TASGRID_ENABLE_PROD_MIGRATION=true
|
||||
VITE_TASGRID_ENABLE_PROD_MIGRATION=false
|
||||
VITE_TASGRID_MIGRATION_ADMIN_EMAILS=tcardoza@cardoza.construction
|
||||
+15
-2
@@ -521,7 +521,13 @@ const buildTaskTags = (
|
||||
...labelTags,
|
||||
...shareRefs.map(ref => {
|
||||
const context = getContextByRef(ref);
|
||||
return buildShareTag(context?.displayName || ref.key);
|
||||
if (context?.displayName) {
|
||||
return buildShareTag(context.displayName);
|
||||
}
|
||||
if (ref.kind === "user" && ref.key.startsWith("user-")) {
|
||||
return null;
|
||||
}
|
||||
return buildShareTag(ref.key);
|
||||
}),
|
||||
...noteRefs.map(ref => {
|
||||
const note = getNoteByRef(ref);
|
||||
@@ -533,7 +539,7 @@ const buildTaskTags = (
|
||||
tags.push(favoriteTag);
|
||||
}
|
||||
|
||||
return [...new Set(tags.filter(Boolean))];
|
||||
return [...new Set(tags.filter((tag): tag is string => !!tag))];
|
||||
};
|
||||
|
||||
const dedupeShareRefs = (refs: TaskShareRef[]) => {
|
||||
@@ -600,6 +606,13 @@ const withActiveContextTags = (rawTags: string[]) => {
|
||||
const setContexts = (contexts: ShareContext[]) => {
|
||||
setStore("contexts", reconcile(contexts));
|
||||
setStore("buckets", reconcile(deriveBuckets(contexts)));
|
||||
setStore("tasks", tasks => tasks.map(task => {
|
||||
const favoriteTag = task.tags.find(tag => tag.endsWith("_favorite__"));
|
||||
return {
|
||||
...task,
|
||||
tags: buildTaskTags(task.labelTags, task.shareRefs, task.noteRefs, favoriteTag)
|
||||
};
|
||||
}));
|
||||
|
||||
const labelDefinitions = store.tagDefinitions.filter(def => !def.name.startsWith("@"));
|
||||
const mergedDefs = [...labelDefinitions, ...deriveSystemTagDefinitions(contexts)];
|
||||
|
||||
Reference in New Issue
Block a user