From 716cb23acbb3666ef324037f381a1899e68f2415 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 20 Jul 2022 20:00:35 +0900 Subject: [PATCH] =?UTF-8?q?fix(client):=20=E3=82=BF=E3=82=A4=E3=83=9F?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E3=81=AB=E3=82=88=E3=81=A3=E3=81=A6=E3=81=AF?= =?UTF-8?q?=20tag-cloud=20=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C?= =?UTF-8?q?=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/components/tag-cloud.vue | 38 ++++++++++---------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/client/src/components/tag-cloud.vue b/packages/client/src/components/tag-cloud.vue index bbebff497f..31ec94bf42 100644 --- a/packages/client/src/components/tag-cloud.vue +++ b/packages/client/src/components/tag-cloud.vue @@ -25,23 +25,25 @@ let tagsEl = $ref(null); let width = $ref(300); watch($$(available), () => { - window.TagCanvas.Start(idForCanvas, idForTags, { - textColour: '#ffffff', - outlineColour: tinycolor(computedStyle.getPropertyValue('--accent')).toHexString(), - outlineRadius: 10, - initial: [-0.030, -0.010], - frontSelect: true, - imageRadius: 8, - //dragControl: true, - dragThreshold: 3, - wheelZoom: false, - reverse: true, - depth: 0.5, - maxSpeed: 0.2, - minSpeed: 0.003, - stretchX: 0.8, - stretchY: 0.8, - }); + try { + window.TagCanvas.Start(idForCanvas, idForTags, { + textColour: '#ffffff', + outlineColour: tinycolor(computedStyle.getPropertyValue('--accent')).toHexString(), + outlineRadius: 10, + initial: [-0.030, -0.010], + frontSelect: true, + imageRadius: 8, + //dragControl: true, + dragThreshold: 3, + wheelZoom: false, + reverse: true, + depth: 0.5, + maxSpeed: 0.2, + minSpeed: 0.003, + stretchX: 0.8, + stretchY: 0.8, + }); + } catch (e) {} }); onMounted(() => { @@ -58,7 +60,7 @@ onMounted(() => { }); onBeforeUnmount(() => { - window.TagCanvas.Delete(idForCanvas); + if (window.TagCanvas) window.TagCanvas.Delete(idForCanvas); }); defineExpose({