From 720fb4af63df3010c7cfaccf586dc3dab4b64432 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sat, 15 Jun 2024 11:34:54 +0200 Subject: [PATCH] Webview: minor improvements --- pkgs/webview-ui/app/src/Config.tsx | 6 +++++- pkgs/webview-ui/app/src/index.tsx | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/webview-ui/app/src/Config.tsx b/pkgs/webview-ui/app/src/Config.tsx index fff8ad57..0966f3ad 100644 --- a/pkgs/webview-ui/app/src/Config.tsx +++ b/pkgs/webview-ui/app/src/Config.tsx @@ -6,6 +6,7 @@ import { createEffect, } from "solid-js"; import { OperationResponse, pyApi } from "./api"; +import { currClanURI } from "./App"; export const makeMachineContext = () => { const [machines, setMachines] = @@ -27,7 +28,10 @@ export const makeMachineContext = () => { getMachines: () => { // When the gtk function sends its data the loading state will be set to false setLoading(true); - pyApi.list_machines.dispatch({ debug: true, flake_url: "." }); + pyApi.list_machines.dispatch({ + debug: true, + flake_url: currClanURI(), + }); }, }, ] as const; diff --git a/pkgs/webview-ui/app/src/index.tsx b/pkgs/webview-ui/app/src/index.tsx index 0d011c3f..6a25caeb 100644 --- a/pkgs/webview-ui/app/src/index.tsx +++ b/pkgs/webview-ui/app/src/index.tsx @@ -14,7 +14,6 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) { ); } -console.log(import.meta.env); if (import.meta.env.DEV) { console.log("Development mode"); // Load the debugger in development mode @@ -27,7 +26,7 @@ if (import.meta.env.DEV) { console.debug("Python API call", { method, data }); setTimeout(() => { const mock = getFakeResponse(method, data); - console.log("mock", { mock }); + console.log("Returning mock-data: ", { mock }); window.clan[method](JSON.stringify(mock)); }, 200);