File tree Expand file tree Collapse file tree 4 files changed +5
-6
lines changed
vue-app-new/src/components
packages/no-modal/src/base Expand file tree Collapse file tree 4 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import "./globals.css";
33import { Inter } from "next/font/google" ;
44
55import Provider from "@/components/provider" ;
6- import { cookieToInitialState } from "@web3auth/modal" ;
6+ import { cookieToWeb3AuthState } from "@web3auth/modal" ;
77import { headers } from "next/headers" ;
88
99const inter = Inter ( { subsets : [ "latin" ] } ) ;
@@ -14,7 +14,7 @@ export const metadata = {
1414} ;
1515
1616export default function RootLayout ( { children } : { children : React . ReactNode } ) {
17- const initialState = cookieToInitialState ( ( headers ( ) ) . get ( 'cookie' ) )
17+ const initialState = cookieToWeb3AuthState ( ( headers ( ) ) . get ( 'cookie' ) )
1818 console . log ( "initialState" , initialState )
1919 return (
2020 < html lang = "en" >
Original file line number Diff line number Diff line change @@ -316,15 +316,14 @@ const canSwitchChainNamespace = computed(() => {
316316});
317317
318318const onSwitchChain = async () => {
319- log .info (" switching chain" , currentChainId . value );
319+ log .info (" switching chain" );
320320 try {
321321 const { chainId } = provider .value as IProvider ;
322322 if (chainId !== currentChainId .value ) throw new Error (" chainId does not match current chainId" );
323323
324324 const currentNamespace = currentChainNamespace .value ;
325325 const newChain = props .chains .find ((x ) => x .chainNamespace === currentNamespace && x .chainId !== chainId );
326326 if (! newChain ) throw new Error (` Please configure at least 2 chains for ${currentNamespace } in the config ` );
327- console .log (" newChain" , newChain .chainId );
328327 const data = await switchChainAsync ({ chainId: Number (newChain .chainId ) });
329328 printToConsole (" switchedChain" , { chainId: data .id });
330329 } catch (error ) {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const cookieStorage = (options?: { expiry?: number }) =>
2525 } ,
2626 } ) satisfies IStorage ;
2727
28- export function cookieToInitialState ( cookie ?: string | null ) {
28+ export function cookieToWeb3AuthState ( cookie ?: string | null ) {
2929 if ( ! cookie ) return undefined ;
3030 const parsed = parseCookie ( cookie , WEB3AUTH_STATE_STORAGE_KEY ) ;
3131 if ( ! parsed ) return undefined ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ export * from "./chain/IChainInterface";
22export * from "./composables" ;
33export * from "./connector" ;
44export * from "./constants" ;
5- export { cookieToInitialState } from "./cookie" ;
5+ export { cookieToWeb3AuthState } from "./cookie" ;
66export * from "./core/IWeb3Auth" ;
77export * from "./errors" ;
88export * from "./hooks" ;
You can’t perform that action at this time.
0 commit comments