1
0
Fork 0
mirror of synced 2024-07-01 12:30:41 +12:00

Fix datasource invalidations not propagating through peek modals

This commit is contained in:
Andrew Kingston 2021-12-07 15:11:13 +00:00
parent 20f3f41327
commit fb23bf5674

View file

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