Skip to content

Commit

Permalink
Merge branch 'main' into chore/api-upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
alecananian committed Sep 20, 2024
2 parents 95360bd + 3d01c9a commit cfe7ebd
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/spicy-swans-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@treasure-dev/tdk-react": patch
"@treasure-dev/tdk-core": patch
---

Skip extra user session fetch on login
5 changes: 0 additions & 5 deletions .changeset/spotty-pumas-trade.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @treasure-dev/tdk-core

## 2.6.1

### Patch Changes

- 291e636: Allow string type for values when sending raw transactions

## 2.6.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@treasure-dev/tdk-core",
"version": "2.6.0",
"version": "2.6.1",
"description": "Treasure Development Kit for TypeScript/JavaScript-based projects",
"keywords": [
"treasure",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/connect/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export const logIn = async (params: ConnectWalletConfig & ConnectConfig) => {
wallet,
chainId,
tdk,
sessions: user.allActiveSigners,
options: sessionOptions,
});
}
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/connect/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,14 @@ export const startUserSession = async ({
wallet,
chainId,
tdk,
sessions: userSessions,
options,
}: {
client: TreasureConnectClient;
wallet: Wallet | undefined;
chainId: number;
tdk: TDKAPI;
sessions?: Session[];
options: SessionOptions;
}) => {
// Skip session creation if not required by app
Expand All @@ -146,7 +148,7 @@ export const startUserSession = async ({
const walletChainId = wallet?.getChain()?.id;

// Skip session creation if user has an active session already
const sessions = await tdk.user.getSessions({ chainId });
const sessions = userSessions ?? (await tdk.user.getSessions({ chainId }));
const hasActiveSession = validateSession({
...options,
sessions,
Expand Down
7 changes: 7 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @treasure-dev/tdk-react

## 2.6.1

### Patch Changes

- Updated dependencies [291e636]
- @treasure-dev/tdk-core@2.6.1

## 2.6.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@treasure-dev/tdk-react",
"version": "2.6.0",
"version": "2.6.1",
"description": "Treasure Development Kit for React-based projects",
"keywords": [
"treasure",
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/contexts/treasure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ const TreasureProviderInner = ({
wallet,
chainId: chain.id,
tdk,
sessions: nextUser.allActiveSigners,
options: sessionOptions,
});
}
Expand Down

0 comments on commit cfe7ebd

Please sign in to comment.