aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DropConverter.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-09-02 12:16:43 -0400
committerbobzel <zzzman@gmail.com>2024-09-02 12:16:43 -0400
commitb453414dc2bb11d56c5dcb2a73d389eefabff7d5 (patch)
tree439ba13733a35bda2afae95cafce22c55b6ead6a /src/client/util/DropConverter.ts
parentcbb74abac69e6f4e6f7f813e57a5cc3280647d39 (diff)
cleaned up updateIcon to use promises to avoid a bunch of setTimeouts
Diffstat (limited to 'src/client/util/DropConverter.ts')
-rw-r--r--src/client/util/DropConverter.ts3
1 files changed, 2 insertions, 1 deletions
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);