Skip to content

Commit

Permalink
fix: blank screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ynwd committed Dec 1, 2024
1 parent 1ecf69c commit d979084
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
13 changes: 8 additions & 5 deletions core/server/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ if (root) fetchProps(root);
if (!match) continue;
const x = await m.handler(
this.#transformRequest(req, match?.pathname.groups, u),
this.#transformCtx(info, u, this.serverOptions),
this.#transformCtx(info, u, this.serverOptions, false),
) as any;

if (x instanceof Response) {
Expand Down Expand Up @@ -495,12 +495,15 @@ if (root) fetchProps(root);
info: Deno.ServeHandlerInfo,
url: URL,
options: Record<string, any>,
page?: boolean,
) => {
const ctx = options as Context;
const r = new Render(this);
ctx.render = <T>(jsx: T) => {
return r.renderJsx(jsx as JSX.Element);
};
if (!page) {
ctx.render = <T>(jsx: T) => {
return r.renderJsx(jsx as JSX.Element);
};
}
ctx.send = <T>(data: T, status = 200) => {
return createResponse(data, status);
};
Expand Down Expand Up @@ -529,7 +532,7 @@ if (root) fetchProps(root);
}
}

const ctx = this.#transformCtx(info, url, this.serverOptions);
const ctx = this.#transformCtx(info, url, this.serverOptions, false);
return this.#record[id] = { handler, ctx, params, url };
};

Expand Down
4 changes: 1 addition & 3 deletions modules/hook/health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const useHealthCheck = () => {

useEffect(() => {
fetchHealthStatus();

const intervalId = setInterval(fetchHealthStatus, 30 * 1000);

const intervalId = setInterval(fetchHealthStatus, 60 * 1000);
return () => clearInterval(intervalId);
}, []);

Expand Down
2 changes: 1 addition & 1 deletion modules/index/index.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ export const handler = async (req: HttpRequest, ctx: Context) => {
destination: "blog/queue",
};

return await ctx.render(obj);
return ctx.render(obj);
};
24 changes: 20 additions & 4 deletions modules/index/index.navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ function Item(props: { data: any }) {
setShow(!show);
};

const handleSendMessage = (_v: any) => {
// create room
// add to users chats
throw new Error("Function not implemented.");
};

const handleSeeProfile = (_v: any) => {
throw new Error("Function not implemented.");
};

return (
<li
class={`relative flex items-center justify-between gap-x-3`}
Expand Down Expand Up @@ -229,13 +239,19 @@ function Item(props: { data: any }) {
<div
class={`absolute ${
show ? "" : "hidden"
} flex flex-col text-xs mt-24 w-full z-10 bg-black border-t border-r border-l border-b rounded-md`}
} flex flex-col text-xs mt-[118px] w-full z-10 bg-black border-t border-r border-l border-b rounded-md`}
>
<div class={`border-b p-1`}>
<div
class={`border-b p-3 cursor-pointer`}
onClick={() => handleSendMessage(props.data)}
>
Send Message
</div>
<div class={`p-1`}>
Profile
<div
class={`p-3 cursor-pointer`}
onClick={() => handleSeeProfile(props.data)}
>
See Profile
</div>
</div>
</li>
Expand Down

0 comments on commit d979084

Please sign in to comment.