Skip to content

Commit

Permalink
[ID-1124]Remove the useCachedSession as a option in connectImx
Browse files Browse the repository at this point in the history
  • Loading branch information
carmen0208 authored Oct 30, 2023
1 parent 3cce32e commit bfcbe8d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
11 changes: 0 additions & 11 deletions packages/passport/sdk/src/Passport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,6 @@ describe('Passport', () => {
expect(result).toBe(passportImxProvider);
expect(getProviderMock).toHaveBeenCalled();
});

it('should call getProviderSilent if useCachedSession is true', async () => {
const passportImxProvider = {} as PassportImxProvider;
getProviderSilentMock.mockResolvedValue(passportImxProvider);

const result = await passport.connectImx({ useCachedSession: true });

expect(result).toBe(passportImxProvider);
expect(getProviderSilentMock).toHaveBeenCalled();
expect(getProviderMock).not.toHaveBeenCalled();
});
});

describe('connectImxSilent', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/passport/sdk/src/Passport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ export class Passport {
return this.passportImxProviderFactory.getProviderSilent();
}

public async connectImx(options?: { useCachedSession: boolean }): Promise<IMXProvider | null> {
const { useCachedSession = false } = options || {};
if (useCachedSession) {
return this.passportImxProviderFactory.getProviderSilent();
}
public async connectImx(): Promise<IMXProvider> {
return this.passportImxProviderFactory.getProvider();
}

Expand Down

0 comments on commit bfcbe8d

Please sign in to comment.