Sync Iframe query string with HF embedder window (#62)
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
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 |
|