Skip to content

Commit 332f11f

Browse files
committed
Switched RestoreArgs to SerializedSession
1 parent 048c0da commit 332f11f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/lib/state/client/wharf.svelte.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
type AccountCreationPlugin,
1313
type CreateAccountOptions,
1414
type LoginOptions,
15-
type RestoreArgs,
1615
type SerializedSession,
1716
type TransactArgs,
1817
type TransactOptions,
@@ -152,7 +151,7 @@ export class WharfState {
152151
}
153152
}
154153

155-
public async restore(args?: RestoreArgs, options?: LoginOptions) {
154+
public async restore(args?: SerializedSession, options?: LoginOptions) {
156155
if (!this.sessionKit) {
157156
throw new Error('User not initialized');
158157
}
@@ -166,14 +165,8 @@ export class WharfState {
166165
}
167166

168167
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);
175169
this.chainsSession[String(serialized.chain)] = serialized;
176-
// TODO: Redirect to the appropriate network in the URL
177170
if (!session) {
178171
throw new Error(`Failed to switch session to ${JSON.stringify(serialized)}`);
179172
}

0 commit comments

Comments
 (0)