KefranAbg commited on
Commit
ac5aecb
·
unverified ·
1 Parent(s): cf0407a

Sync Iframe query string with HF embedder window (#62)

Browse files
Files changed (1) hide show
  1. src/lib/stores/session.ts +6 -1
src/lib/stores/session.ts CHANGED
@@ -85,7 +85,12 @@ function createSessionStore() {
85
  const newQuery = query.toString();
86
  // slice to remove the ? prefix
87
  if (newQuery !== prevQuery.slice(1)) {
88
- console.log(prevQuery, newQuery);
 
 
 
 
 
89
  goto(`?${query}`, { replaceState: true });
90
  }
91
 
 
85
  const newQuery = query.toString();
86
  // slice to remove the ? prefix
87
  if (newQuery !== prevQuery.slice(1)) {
88
+ window.parent.postMessage(
89
+ {
90
+ queryString: query.toString(),
91
+ },
92
+ "https://huggingface.co"
93
+ );
94
  goto(`?${query}`, { replaceState: true });
95
  }
96