diff --git a/src/Components/Viewer.tsx b/src/Components/Viewer.tsx index adefea43..0d591d98 100644 --- a/src/Components/Viewer.tsx +++ b/src/Components/Viewer.tsx @@ -56,7 +56,7 @@ function setupAppProxyPath(proxy: PyodideProxy | WebRProxy): { function createHttpRequestChannel( proxy: PyodideProxy | WebRProxy, appName: string, - urlPath: string + urlPath: string, ): MessageChannel { if (!navigator.serviceWorker.controller) { throw new Error("ServiceWorker controller was not found!"); @@ -79,7 +79,7 @@ function createHttpRequestChannel( type: "configureProxyPath", path: urlPath, }, - [httpRequestChannel.port2] + [httpRequestChannel.port2], ); return httpRequestChannel; @@ -88,7 +88,7 @@ function createHttpRequestChannel( async function resetPyAppFrame( pyodide: PyodideProxy, appName: string, - appFrame: HTMLIFrameElement + appFrame: HTMLIFrameElement, ): Promise { // Reset the app iframe before shutting down the app, so that the user doesn't // see the flash of gray indicating a closed session. @@ -96,7 +96,7 @@ async function resetPyAppFrame( const stoppedPreviousApp = (await pyodide.runPyAsync( `_stop_app('${appName}')`, - { returnResult: "value", printResult: false } + { returnResult: "value", printResult: false }, )) as boolean; // If we stopped a previously-running app, pause for a bit before continuing. @@ -108,7 +108,7 @@ async function resetPyAppFrame( async function resetRAppFrame( webRProxy: WebRProxy, appName: string, - appFrame: HTMLIFrameElement + appFrame: HTMLIFrameElement, ): Promise { // Reset the app iframe before shutting down the app, so that the user doesn't // see the flash of gray indicating a closed session. @@ -136,7 +136,7 @@ export function Viewer({ >("loading"); const shinyIntervalRef = React.useRef(0); const [lastErrorMessage, setLastErrorMessage] = React.useState( - null + null, ); // Shiny for R @@ -171,8 +171,8 @@ export function Viewer({ Object.fromEntries( appCode.map((file) => { return [file.name, file.content]; - }) - ) + }), + ), ); try { await webRProxy.runRAsync(".save_files(files, appDir)", { @@ -195,7 +195,7 @@ export function Viewer({ webRProxy.runRAsync(".shiny_tick()"); }, 100); - viewerFrameRef.current.src = appInfo.urlPath; + viewerFrameRef.current.src = appInfo.urlPath + window.location.search; setAppRunningState("running"); } catch (e) { setAppRunningState("errored"); @@ -264,7 +264,7 @@ export function Viewer({ args: [appName], }); - viewerFrameRef.current.src = appInfo.urlPath; + viewerFrameRef.current.src = appInfo.urlPath + window.location.search; setAppRunningState("running"); } catch (e) { setAppRunningState("errored"); @@ -283,7 +283,7 @@ export function Viewer({ await resetPyAppFrame( pyodideproxy, appInfo.appName, - viewerFrameRef.current + viewerFrameRef.current, ); setAppRunningState("empty"); }