fix: lazy load 3d view

This commit is contained in:
max_richter 2021-03-16 16:30:07 +01:00
parent e4b3cce517
commit 738f814ecb

View File

@ -7,7 +7,6 @@
imageToArray,
} from "helpers";
import { images as imageStore } from "stores";
import OrbView from "./OrbView";
import { onMount } from "svelte";
import Toast from "components/Toast";
import { throttle } from "lodash";
@ -263,11 +262,14 @@
polygonPoints.length === 2 ? cx1.stroke() : cx1.fill();
}
function switchViewMode(e: MouseEvent) {
let OrbView;
async function switchViewMode(e: MouseEvent) {
e.stopPropagation();
e.stopImmediatePropagation();
e.preventDefault();
if (!OrbView) OrbView = (await import("./OrbView")).default;
mode = mode === "2d" ? "3d" : "2d";
if (mode === "3d") {