File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
type AccountCreationPlugin ,
13
13
type CreateAccountOptions ,
14
14
type LoginOptions ,
15
+ type PartialSerializedSession ,
15
16
type SerializedSession ,
16
17
type TransactArgs ,
17
18
type TransactOptions ,
@@ -151,7 +152,7 @@ export class WharfState {
151
152
}
152
153
}
153
154
154
- public async restore ( args ?: SerializedSession , options ?: LoginOptions ) {
155
+ public async restore ( args ?: PartialSerializedSession , options ?: LoginOptions ) {
155
156
if ( ! this . sessionKit ) {
156
157
throw new Error ( 'User not initialized' ) ;
157
158
}
@@ -164,12 +165,12 @@ export class WharfState {
164
165
return session ;
165
166
}
166
167
167
- public async switch ( serialized : SerializedSession ) : Promise < Session > {
168
+ public async switch ( serialized : PartialSerializedSession ) : Promise < Session > {
168
169
const session = await this . restore ( serialized ) ;
169
- this . chainsSession [ String ( serialized . chain ) ] = serialized ;
170
170
if ( ! session ) {
171
171
throw new Error ( `Failed to switch session to ${ JSON . stringify ( serialized ) } ` ) ;
172
172
}
173
+ this . chainsSession [ String ( session . chain ) ] = session . serialize ( ) ;
173
174
return session ;
174
175
}
175
176
You can’t perform that action at this time.
0 commit comments