mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-30 11:34:20 +01:00
fix tagToMutinyTag ts error
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user