mirror of
https://github.com/lumina-rocks/lumina.git
synced 2026-06-05 10:11:16 +02:00
WIP
This commit is contained in:
@@ -10,6 +10,7 @@ import { Inter } from "next/font/google";
|
||||
import { Toaster } from "@/components/ui/toaster"
|
||||
import Script from "next/script";
|
||||
import Umami from "@/components/Umami";
|
||||
import { useEffect } from "react";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
@@ -19,6 +20,15 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
|
||||
useEffect(() => {
|
||||
// handle Amber Sign Response
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const amberSignResponse = urlParams.get('amberSignResponse');
|
||||
if (amberSignResponse !== null) {
|
||||
alert(amberSignResponse);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const relayUrls = [
|
||||
"wss://relay.nostr.band",
|
||||
"wss://relay.damus.io",
|
||||
|
||||
@@ -31,8 +31,18 @@ export async function signEvent(loginType: string | null, event: NostrEvent): Pr
|
||||
eventSigned = await window.nostr.signEvent(event);
|
||||
} else if (loginType === 'amber') {
|
||||
// TODO: Sign event with amber
|
||||
alert('Signing with Amber is not implemented yet, sorry!');
|
||||
return null;
|
||||
// alert('Signing with Amber is not implemented yet, sorry!');
|
||||
// return null;
|
||||
|
||||
// get the full current url of the user
|
||||
let callbackUrl = window.location.host + window.location.pathname;
|
||||
|
||||
console.log(callbackUrl);
|
||||
if (!callbackUrl) {
|
||||
throw new Error("Callback URL is null or undefined but needed for Amber Signing");
|
||||
}
|
||||
const intent = `intent:#Intent;scheme=nostrsigner;S.compressionType=gzip;S.returnType=signature;S.type=get_public_key;S.callbackUrl=http://${callbackUrl}?amberSignResponse=;end`;
|
||||
window.location.href = intent;
|
||||
} else if (loginType === 'raw_nsec') {
|
||||
if (typeof window !== 'undefined') {
|
||||
let nsecStr = null;
|
||||
|
||||
Reference in New Issue
Block a user