Skip to content

Commit 3b0be5d

Browse files
committed
GO-5904: Fix null format for type of layout note without icon
1 parent 5fb3709 commit 3b0be5d

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

src/utils/icon.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ import { colorToHex, iconWidth } from "./constant";
1111
* @returns The base64 data URI or Raycast Icon.
1212
*/
1313
export async function getIconWithFallback(icon: ObjectIcon, layout: string, type?: RawType): Promise<Image.ImageLike> {
14-
// notes always show grey type icon
15-
if (layout === ObjectLayout.Note) {
16-
if (type?.icon.format === IconFormat.Icon && type?.icon.name) {
17-
return getCustomTypeIcon(type.icon.name, "grey");
18-
} else {
19-
console.warn("note type has no icon", type);
20-
}
21-
}
22-
2314
if (icon && icon.format) {
2415
// type built-in icons
2516
if (icon.format === IconFormat.Icon && icon.name) {
@@ -32,10 +23,6 @@ export async function getIconWithFallback(icon: ObjectIcon, layout: string, type
3223
if (fileSource) {
3324
return { source: fileSource, mask: getMaskForObject(icon.file, layout) };
3425
}
35-
if (type?.icon.format === IconFormat.Icon && type?.icon.name) {
36-
return getCustomTypeIcon(type.icon.name, "grey");
37-
}
38-
return await fallbackToLayout(layout);
3926
}
4027

4128
// regular emoji
@@ -46,7 +33,7 @@ export async function getIconWithFallback(icon: ObjectIcon, layout: string, type
4633

4734
// fallback to grey version of type built-in icon
4835
if (type?.icon && type.icon.format === IconFormat.Icon && type.icon.name) {
49-
return getCustomTypeIcon(type?.icon.name, "grey");
36+
return getCustomTypeIcon(type.icon.name, "grey");
5037
}
5138

5239
// fallback to layout

0 commit comments

Comments
 (0)