fix tagToMutinyTag ts error

This commit is contained in:
gawlk
2023-08-16 15:49:28 +02:00
committed by Paul Miller
parent c01c9cc7f7
commit 6fa32d1949

View File

@@ -25,8 +25,21 @@ export function tagsToIds(tags?: MutinyTagItem[]): string[] {
}
export function tagToMutinyTag(tag: TagItem): MutinyTagItem {
// @ts-expect-error: FIXME: make typescript less mad about this
return tag as MutinyTagItem;
let kind: MutinyTagItem["kind"];
switch (tag.kind) {
case 0: {
kind = "Label";
break;
}
case 1:
default: {
kind = "Contact";
break;
}
}
return { ...tag, kind };
}
export function sortByLastUsed(a: MutinyTagItem, b: MutinyTagItem) {