Prevent client app links from functioning in the builder preview

This commit is contained in:
Andrew Kingston 2021-01-06 10:14:05 +00:00
parent a40bf95c41
commit 34509e0c12
2 changed files with 11 additions and 1 deletions

View File

@ -1,8 +1,8 @@
import * as API from "./api"
import { authStore, routeStore, screenStore, bindingStore } from "./store"
import { styleable } from "./utils/styleable"
import { linkable } from "./utils/linkable"
import { getAppId } from "./utils/getAppId"
import { link as linkable } from "svelte-spa-router"
import DataProvider from "./components/DataProvider.svelte"
export default {

View File

@ -0,0 +1,10 @@
import { get } from "svelte/store"
import { link } from "svelte-spa-router"
import { builderStore } from "../store"
export const linkable = (node, href) => {
if (get(builderStore).inBuilder) {
return
}
link(node, href)
}