From b453414dc2bb11d56c5dcb2a73d389eefabff7d5 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 2 Sep 2024 12:16:43 -0400 Subject: cleaned up updateIcon to use promises to avoid a bunch of setTimeouts --- src/client/util/DropConverter.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client/util') diff --git a/src/client/util/DropConverter.ts b/src/client/util/DropConverter.ts index 57c79cff3..0ede44298 100644 --- a/src/client/util/DropConverter.ts +++ b/src/client/util/DropConverter.ts @@ -92,7 +92,8 @@ export function makeUserTemplateButton(doc: Doc) { * Similar to makeUserTemplateButton, but rather than creating a draggable button for the template, it takes in * an ImageField that will display. */ -export function makeUserTemplateImage(doc: Doc, image: ImageField) { +export function makeUserTemplateImage(doc: Doc, imageHref: string | undefined) { + const image = imageHref ?? 'http://www.cs.brown.edu/~bcz/noImage.png'; const layoutDoc = doc; // doc.layout instanceof Doc && doc.layout.isTemplateForField ? doc.layout : doc; if (layoutDoc.type !== DocumentType.FONTICON) { !layoutDoc.isTemplateDoc && makeTemplate(layoutDoc); -- cgit v1.2.3-70-g09d2