Skip to content

Commit

Permalink
fix: incorrectly turned path and dark into one object
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko committed Feb 20, 2024
1 parent 5909b8b commit a4f5556
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/solara-widget-manager/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ export class WidgetManager extends JupyterLabManager {
await this._loadFromKernel();
}

async run(appName: string, path: string) {
async run(appName: string, args: any) {
let { path } = args;
// used for routing
// should be similar to what we do in navigator.vue
if (typeof path === 'undefined') {
Expand All @@ -173,7 +174,7 @@ export class WidgetManager extends JupyterLabManager {
}
};
});
this.controlComm.send({ method: 'run', path, appName: appName || null });
this.controlComm.send({ method: 'run', args: { ...args, appName: appName || null } });
const widget_id = await widget_id_promise;
return widget_id;
}
Expand Down
7 changes: 4 additions & 3 deletions solara/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,12 @@ def on_msg(msg):
data = msg["content"]["data"]
method = data["method"]
if method == "run":
path = data.get("path", "")
app_name = data.get("appName") or "__default__"
args = data["args"]
path = args.get("path", "")
app_name = args.get("appName") or "__default__"
app = apps[app_name]
context = kernel_context.get_current_context()
dark = data.get("darkMode", False)
dark = args.get("dark", False)
import ipyvuetify

from solara.lab import theme
Expand Down
2 changes: 1 addition & 1 deletion solara/server/static/main-vuetify.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ async function solaraInit(mountId, appName) {
if (kernelId && widgetModelId) {
await widgetManager.fetchAll();
} else {
widgetModelId = await widgetManager.run(appName, {path, darkMode: inDarkMode()});
widgetModelId = await widgetManager.run(appName, {path, dark: inDarkMode()});
}
await solaraMount(widgetManager, mountId || 'content', widgetModelId);
skipReconnectedCheck = false;
Expand Down

0 comments on commit a4f5556

Please sign in to comment.