Signup flow

This commit is contained in:
2023-07-20 12:33:00 +01:00
parent a1605e31d5
commit c74bbae5c7
24 changed files with 389 additions and 77 deletions

View File

@ -55,4 +55,20 @@ export function eventLink(ev: NostrEvent) {
export function getHost(ev?: NostrEvent) {
return ev?.tags.find(a => a[0] === "p" && a[3] === "host")?.[1] ?? ev?.pubkey ?? "";
}
export async function openFile(): Promise<File | undefined> {
return new Promise(resolve => {
const elm = document.createElement("input");
elm.type = "file";
elm.onchange = (e: Event) => {
const elm = e.target as HTMLInputElement;
if (elm.files) {
resolve(elm.files[0]);
} else {
resolve(undefined);
}
};
elm.click();
});
}