From 31f8a8a85614cdfc1aab84656f1a9de20011cf6c Mon Sep 17 00:00:00 2001 From: Rizky Date: Tue, 27 Aug 2024 06:25:32 +0700 Subject: [PATCH] fix --- app/web/src/nova/ed/panel/popup/api/api-server.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/web/src/nova/ed/panel/popup/api/api-server.tsx b/app/web/src/nova/ed/panel/popup/api/api-server.tsx index 5ddb9dbb..558e8735 100644 --- a/app/web/src/nova/ed/panel/popup/api/api-server.tsx +++ b/app/web/src/nova/ed/panel/popup/api/api-server.tsx @@ -1,12 +1,12 @@ +import trim from "lodash.trim"; import { forwardRef } from "react"; import { useGlobal, useLocal } from "web-utils"; +import { deploy_target } from "../../../../../../../db/db"; import { Modal } from "../../../../../utils/ui/modal"; +import { Popover } from "../../../../../utils/ui/popover"; import { EDGlobal } from "../../../logic/ed-global"; import { EdApiTab } from "./api-tab"; -import trim from "lodash.trim"; -import { Popover } from "../../../../../utils/ui/popover"; -import { deploy_target } from "../../../../../../../db/db"; -import { apiRef, apiUrl } from "./api-utils"; +import { server } from "./api-utils"; export const EdPopApi = () => { const p = useGlobal(EDGlobal, "EDITOR"); @@ -234,8 +234,9 @@ export const EdApiServer = forwardRef< id_site={p.site.id} api_url={p.site.config.api_url} onUpdate={async ({ api_url }) => { + p.render(); + if (local.active === 0) { - p.render(); p.site.config.api_url = trim(api_url, "/"); await p.sync?.site.update(p.site.id, { config: { api_url: api_url }, @@ -247,6 +248,8 @@ export const EdApiServer = forwardRef< data: { api_url }, }); } + server.status = "ready"; + p.render(); }} />