@tinacms/app 0.0.23 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,7 +90,7 @@ const QueryMachine = (props: {
90
90
  React.useEffect(() => {
91
91
  if (state.matches('pipeline.ready')) {
92
92
  cms.events.dispatch({ type: 'forms:register', value: 'complete' })
93
- } else {
93
+ } else if (state.matches('pipeline.initializing')) {
94
94
  cms.events.dispatch({ type: 'forms:register', value: 'start' })
95
95
  }
96
96
  }, [JSON.stringify(state.value)])
@@ -101,6 +101,12 @@ const QueryMachine = (props: {
101
101
  if (props.payload.type === 'open') {
102
102
  send({ type: 'ADD_QUERY', value: props.payload })
103
103
  }
104
+ window.addEventListener('message', (event: MessageEvent<PostMessage>) => {
105
+ // useTinaHook cleans itself up when the component unmounts by sending a close message
106
+ if (event.data.type === 'close') {
107
+ send({ type: 'REMOVE_QUERY' })
108
+ }
109
+ })
104
110
  }
105
111
  }, [props.iframeRef.current])
106
112
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -28,7 +28,7 @@
28
28
  "@types/react": "17.0.2",
29
29
  "@types/react-dom": "17.0.2",
30
30
  "@tinacms/scripts": "0.51.3",
31
- "tinacms": "0.69.18",
31
+ "tinacms": "0.69.19",
32
32
  "jest": "^27.0.6"
33
33
  },
34
34
  "dependencies": {