Skip to content

Commit

Permalink
code review 2
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysu committed Jul 28, 2023
1 parent b81ff5c commit 08d7e59
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 26 deletions.
8 changes: 4 additions & 4 deletions packages/react-web/src/inbox/useXmtpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
PendingSigningRequestError,
UserRejectedError,
WalletConnectionError,
useActiveWalletController,
useActiveWalletInteractor,
useInboxKeyStorage,
} from '@lens-protocol/react';
import { assertError } from '@lens-protocol/shared-kernel';
Expand Down Expand Up @@ -57,7 +57,7 @@ export function useXmtpClient(): UseXmtpClientResult {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState<UseXmtpClientResult['error']>();

const activeWalletController = useActiveWalletController();
const activeWallet = useActiveWalletInteractor();
const storage = useInboxKeyStorage();

const initializeWithLens = useCallback(
Expand All @@ -67,7 +67,7 @@ export function useXmtpClient(): UseXmtpClientResult {

try {
const existingKeys = await loadKeys(storage);
const signer = new SignerAdapter(activeWalletController);
const signer = new SignerAdapter(activeWallet);

if (existingKeys) {
const newClient = await initialize({
Expand Down Expand Up @@ -97,7 +97,7 @@ export function useXmtpClient(): UseXmtpClientResult {
setIsLoading(false);
}
},
[activeWalletController, initialize, storage],
[activeWallet, initialize, storage],
);

return {
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/experimental/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './useActiveWalletController';
export * from './useActiveWalletInteractor';
export * from './useApolloClient';
export * from './useEnvironmentConfig';
export * from './useInboxKeyStorage';
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useSharedDependencies } from '../shared';
*
* @internal
*/
export function useActiveWalletController(): ActiveWallet {
export function useActiveWalletInteractor(): ActiveWallet {
const { activeWallet } = useSharedDependencies();

return activeWallet;
Expand Down
13 changes: 0 additions & 13 deletions packages/react/src/experimental/useEnvironmentConfig.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages/react/src/profile/useProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export function useProfile({
);

const { data, error, loading } = useReadResult(
useGetProfile({
...useLensApolloClient(
useGetProfile(
useLensApolloClient(
useActiveProfileAsDefaultObserver({
variables: useMediaTransformFromConfig(
useSourcesFromConfig({
Expand All @@ -59,7 +59,7 @@ export function useProfile({
skip,
}),
),
}),
),
);

if (loading) {
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/profile/useProfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ export function useProfiles({
);

return usePaginatedReadResult(
useGetAllProfiles({
...useLensApolloClient(
useGetAllProfiles(
useLensApolloClient(
useActiveProfileAsDefaultObserver({
variables: useMediaTransformFromConfig(
useSourcesFromConfig({ byHandles, byProfileIds, limit, observerId }),
),
skip,
}),
),
}),
),
);
}

0 comments on commit 08d7e59

Please sign in to comment.