From 76ca98e3edc4193ca6f362de54b6fa6fbca9304a Mon Sep 17 00:00:00 2001 From: Zsolt Viczian Date: Sat, 8 May 2021 07:51:15 +0200 Subject: [PATCH] 1.0.9 minor fix to theme in ExcalidrawAutomate --- manifest.json | 2 +- src/ExcalidrawTemplate.ts | 26 +++++++++++++++----------- versions.json | 1 + 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/manifest.json b/manifest.json index 3c5d8f0..ac1ceb0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "1.0.8", + "version": "1.0.9", "minAppVersion": "0.11.13", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/src/ExcalidrawTemplate.ts b/src/ExcalidrawTemplate.ts index cc55db6..972a453 100644 --- a/src/ExcalidrawTemplate.ts +++ b/src/ExcalidrawTemplate.ts @@ -141,7 +141,7 @@ export function initExcalidrawAutomate(plugin: ExcalidrawPlugin) { this.canvas.theme = "light"; return "light"; default: - this.canvas = "dark"; + this.canvas.theme = "dark"; return "dark"; } }, @@ -152,7 +152,8 @@ export function initExcalidrawAutomate(plugin: ExcalidrawPlugin) { }); }, async toClipboard(templatePath?:string) { - let elements = templatePath ? (await getTemplate(templatePath)).elements : []; + const template = templatePath ? (await getTemplate(templatePath)) : null; + let elements = template ? template.elements : []; for (let i=0;i