Fix datasource invalidations not propagating through peek modals
This commit is contained in:
parent
20f3f41327
commit
fb23bf5674
|
@ -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,13 @@ 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({
|
const inModal = get(routeStore).queryParams?.peek
|
||||||
type: "close-screen-modal",
|
if (inModal) {
|
||||||
detail: { dataSourceId },
|
window.parent.postMessage({
|
||||||
})
|
type: "invalidate-datasource",
|
||||||
|
detail: { dataSourceId },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
let invalidations = [dataSourceId]
|
let invalidations = [dataSourceId]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue