diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-07-20 20:00:35 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-07-20 20:00:35 +0900 |
| commit | 716cb23acbb3666ef324037f381a1899e68f2415 (patch) | |
| tree | e5bf5a02ca65aa8a63f7bc1cfb5edbc05bfeae54 /packages/client/src/components | |
| parent | chore(client): tweak radio component (diff) | |
| download | misskey-716cb23acbb3666ef324037f381a1899e68f2415.tar.gz misskey-716cb23acbb3666ef324037f381a1899e68f2415.tar.bz2 misskey-716cb23acbb3666ef324037f381a1899e68f2415.zip | |
fix(client): タイミングによっては tag-cloud でエラーが発生するのを修正
Diffstat (limited to 'packages/client/src/components')
| -rw-r--r-- | packages/client/src/components/tag-cloud.vue | 38 |
1 files 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<HTMLElement | null>(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({ |