This commit is contained in:
Samuel Andert 2023-07-25 15:54:36 +02:00
parent 38ec75d19b
commit b560897e17
5 changed files with 27 additions and 20 deletions

View File

@ -8,7 +8,7 @@
const redirectUri = 'http://localhost:5173/';
export let setupLitProvider;
export let setupLit;
let view = 'sign_in';
let sessionSigs;
@ -30,8 +30,7 @@
onMount(async () => {
try {
provider = await setupLitProvider.setupLitProvider();
setupLitProvider.alertMe();
provider = await setupLit.connectProvider();
logMessage('Component mounted.');

View File

@ -7,7 +7,10 @@
const store = getComponentStore(id);
$: console.log('store:', $store);
export let helloEarthAlert;
onMount(async () => {
helloEarthAlert.alertMe();
console.log('hello Earth');
});
</script>

View File

@ -0,0 +1,3 @@
export function alertMe() {
alert("Hello Earth")
}

View File

@ -10,7 +10,7 @@ import { LitNodeClient } from '@lit-protocol/lit-node-client';
let provider: BaseProvider | undefined;
export async function setupLitProvider() {
export async function connectProvider() {
const litNodeClient = new LitNodeClient({
litNetwork: 'serrano',
debug: false
@ -28,7 +28,3 @@ export async function setupLitProvider() {
return provider;
}
export function alertMe() {
alert("hello")
}

View File

@ -5,20 +5,27 @@
layout: `
grid-template-areas:
"auth",
"hello",
"google"
grid-template-rows: 1fr 1fr;
"header",
"main",
"footer"
grid-template-rows: 1fr 1fr auto;
`,
children: [
{
id: 'authsig',
componentName: 'HelloEarth',
slot: 'hello'
id: '1',
componentName: 'GoogleAuth',
slot: 'header',
services: ['setupLit']
},
{
id: '2',
componentName: 'Messages',
slot: 'Main'
},
// {
// id: 'wallet1',
// id: '2',
// componentName: 'Wallet',
// slot: 'play',
// slot: 'main',
// state: {
// rpcURL: 'https://rpc.gnosischain.com/',
// pkpPubKey:
@ -26,10 +33,9 @@
// }
// },
{
id: 'google',
componentName: 'GoogleAuth',
slot: 'google',
services: ['setupLitProvider']
id: '3',
componentName: 'Terminal',
slot: 'footer'
}
]
};