Compare commits
3 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 7aed936a0b | |
Derrick Hammer | ccce11d34d | |
Derrick Hammer | dfe87396b9 |
|
@ -1,3 +1,10 @@
|
||||||
|
# [0.1.0-develop.18](https://git.lumeweb.com/LumeWeb/sdk/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-10-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* only use the private key, not extended ([dfe8739](https://git.lumeweb.com/LumeWeb/sdk/commit/dfe87396b9770a8c37d22bd7d30c0904bd16082c))
|
||||||
|
|
||||||
# [0.1.0-develop.17](https://git.lumeweb.com/LumeWeb/sdk/compare/v0.1.0-develop.16...v0.1.0-develop.17) (2023-10-12)
|
# [0.1.0-develop.17](https://git.lumeweb.com/LumeWeb/sdk/compare/v0.1.0-develop.16...v0.1.0-develop.17) (2023-10-12)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/sdk",
|
"name": "@lumeweb/sdk",
|
||||||
"version": "0.1.0-develop.17",
|
"version": "0.1.0-develop.18",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/sdk",
|
"name": "@lumeweb/sdk",
|
||||||
"version": "0.1.0-develop.17",
|
"version": "0.1.0-develop.18",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/kernel-network-registry-client": "0.1.0-develop.10",
|
"@lumeweb/kernel-network-registry-client": "0.1.0-develop.10",
|
||||||
"@lumeweb/libkernel": "0.1.0-develop.65",
|
"@lumeweb/libkernel": "0.1.0-develop.65",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/sdk",
|
"name": "@lumeweb/sdk",
|
||||||
"version": "0.1.0-develop.17",
|
"version": "0.1.0-develop.18",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/src/index.d.ts",
|
"types": "lib/src/index.d.ts",
|
||||||
|
|
|
@ -6,14 +6,18 @@ import {
|
||||||
import { useLume } from "../LumeProvider";
|
import { useLume } from "../LumeProvider";
|
||||||
import React, { useContext } from "react";
|
import React, { useContext } from "react";
|
||||||
|
|
||||||
export const LumeIdentityContext = React.createContext<{open: boolean, setOpen: (open: boolean) => void} | undefined>(undefined);
|
export const LumeIdentityContext = React.createContext<
|
||||||
|
{ open: boolean; setOpen: (open: boolean) => void } | undefined
|
||||||
|
>(undefined);
|
||||||
|
|
||||||
export function useLumeIndentity() {
|
export function useLumeIndentity() {
|
||||||
const { isLoggedIn, setIsLoggedIn } = useLume();
|
const { isLoggedIn, setIsLoggedIn } = useLume();
|
||||||
const ctx = useContext(LumeIdentityContext);
|
const ctx = useContext(LumeIdentityContext);
|
||||||
|
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
throw new Error("useLumeIdentity should be used inside LumeIdentityContext.Provider")
|
throw new Error(
|
||||||
|
"useLumeIdentity should be used inside LumeIdentityContext.Provider",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { setOpen } = ctx;
|
const { setOpen } = ctx;
|
||||||
|
@ -21,7 +25,7 @@ export function useLumeIndentity() {
|
||||||
return {
|
return {
|
||||||
isSignedIn: isLoggedIn,
|
isSignedIn: isLoggedIn,
|
||||||
async signIn(key: Uint8Array) {
|
async signIn(key: Uint8Array) {
|
||||||
await login(key);
|
await login(key.slice(0, 32));
|
||||||
// await loginComplete(); # this function is buggy `auth.ts:42 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'promise') `
|
// await loginComplete(); # this function is buggy `auth.ts:42 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'promise') `
|
||||||
setIsLoggedIn(true);
|
setIsLoggedIn(true);
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
|
|
Loading…
Reference in New Issue