Browse Source

Prevent client app links from functioning in the builder preview

pull/972/head
Andrew Kingston 6 years ago
parent
commit
f7496579b7
  1. 2
      packages/client/src/sdk.js
  2. 10
      packages/client/src/utils/linkable.js

2
packages/client/src/sdk.js

@ -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 {

10
packages/client/src/utils/linkable.js

@ -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)
}
Loading…
Cancel
Save