Fix datasource invalidation proxying from peek modals not working

This commit is contained in:
Andrew Kingston 2021-12-14 14:04:37 +00:00
parent 43fe2407e1
commit b31bb9be1d
1 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import { writable, get } from "svelte/store" import { writable, get } from "svelte/store"
import { fetchTableDefinition } from "../api" import { fetchTableDefinition } from "../api"
import { FieldTypes } from "../constants" import { FieldTypes } from "../constants"
import { routeStore } from "./routes"
export const createDataSourceStore = () => { export const createDataSourceStore = () => {
const store = writable([]) const store = writable([])
@ -60,10 +61,12 @@ export const createDataSourceStore = () => {
// Emit this as a window event, so parent screens which are iframing us in // Emit this as a window event, so parent screens which are iframing us in
// can also invalidate the same datasource // can also invalidate the same datasource
window.parent.postMessage({ if (get(routeStore).queryParams?.peek) {
type: "close-screen-modal", window.parent.postMessage({
detail: { dataSourceId }, type: "invalidate-datasource",
}) detail: { dataSourceId },
})
}
let invalidations = [dataSourceId] let invalidations = [dataSourceId]