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