Windows build
This commit is contained in:
@@ -69,7 +69,7 @@ function ask<T extends string | boolean>(question: (id: number) => ClientMessage
|
||||
return new Promise((resolve) => asking.set(id, resolve as (answer: string | boolean) => void));
|
||||
}
|
||||
|
||||
function native_platform(page: URL, stored: Record<string, string>): Platform {
|
||||
function native_platform(page: URL, stored: Record<string, string>, credits: string | undefined): Platform {
|
||||
const storage = new Map(Object.entries(stored));
|
||||
return {
|
||||
page,
|
||||
@@ -104,7 +104,7 @@ function native_platform(page: URL, stored: Record<string, string>): Platform {
|
||||
const title = `Join ${address.base.host}?`;
|
||||
return ask((id) => ({ type: "ask", id, title, text, yes: "Join", no: "Cancel" }));
|
||||
},
|
||||
credits_screen: (on_back) => new TextCreditsScreen(on_back),
|
||||
credits_screen: (on_back) => new TextCreditsScreen(on_back, credits),
|
||||
read_clipboard: () => ask((id) => ({ type: "read_clipboard", id })),
|
||||
write_clipboard(text) {
|
||||
post({ type: "write_clipboard", text });
|
||||
@@ -133,7 +133,7 @@ function native_platform(page: URL, stored: Record<string, string>): Platform {
|
||||
}
|
||||
|
||||
async function start(message: Extract<WindowMessage, { type: "start" }>) {
|
||||
set_platform(native_platform(new URL(message.page), message.storage));
|
||||
set_platform(native_platform(new URL(message.page), message.storage, message.credits));
|
||||
const { surface: handles, width, height } = message;
|
||||
const surface = new Deno.UnsafeWindowSurface({
|
||||
system: handles.system,
|
||||
|
||||
Reference in New Issue
Block a user