Skip to content

Commit

Permalink
fix: fixed sepolia ud issues (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 authored Nov 16, 2023
1 parent 7012721 commit 61979e5
Show file tree
Hide file tree
Showing 6 changed files with 809 additions and 1,203 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ChatViewComponentTest = () => {
<h2>Chat UI Test page</h2>
<CreateGroupModal onClose={()=>{console.log('in close')}} />
<ChatViewComponentCard>
<CreateGroupModal onClose={()=>{console.log('in close')}} modalBackground={MODAL_BACKGROUND_TYPE.OVERLAY} modalPositionType={MODAL_POSITION_TYPE.RELATIVE}/>
{/* <CreateGroupModal onClose={()=>{console.log('in close')}} modalBackground={MODAL_BACKGROUND_TYPE.OVERLAY} modalPositionType={MODAL_POSITION_TYPE.RELATIVE}/> */}

<ChatView
onVerificationFail={() => console.log("BOIIII RETURNNNSSSSS")}
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/sdk-frontend-react/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export function App() {
<Web3Context.Provider value={{ account, active, library, chainId }}>
<SocketContext.Provider value={socketData}>
<AccountContext.Provider value={{ pgpPrivateKey, setSpaceId }}>
<ChatUIProvider env={env} theme={lightChatTheme} >
<ChatUIProvider env={env} theme={lightChatTheme} signer={signer}>
<SpacesUIProvider spaceUI={spaceUI} theme={customDarkTheme}>
<Routes>
<Route
Expand Down
15 changes: 10 additions & 5 deletions packages/uiweb/src/lib/helpers/chat/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,19 @@ export const getAddress = async (searchText: string, env: Env) => {
let address: string | null = null;
if (searchText.includes('.')) {
try {
address =
(await udResolver.owner(searchText)) ||
(await provider.resolveName(searchText));
return address;
address = await udResolver.owner(searchText);
} catch (err) {
console.log(err);
return null;
}
if (!address) {
try {
address = await provider.resolveName(searchText);
} catch (err) {
console.log(err);
}
}

return address || null;
} else if (await ethers.utils.isAddress(pCAIP10ToWallet(searchText))) {
return searchText;
} else {
Expand Down
4 changes: 3 additions & 1 deletion packages/uiweb/src/lib/helpers/udResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import type { Env } from '@pushprotocol/restapi';
export const getUdResolver = (env:Env): Resolution => {
const l1ChainId = allowedNetworks[env].includes(1) ? 1 : 5;
const l2ChainId = allowedNetworks[env].includes(137) ? 137 : 80001;
// ToDo: Enable for sepolia chainId once UD supports it
// const l1ChainId = appConfig.allowedNetworks.includes(1) ? 1 : 11155111;
return Resolution.fromEthersProvider({
uns: {
locations: {
Layer1: {
network: NETWORK_DETAILS[l1ChainId].network,
network: "mainnet", // add config for sepolia once it's supported by UD
provider: new ethers.providers.InfuraProvider(l1ChainId, InfuraAPIKey),
},
Layer2: {
Expand Down
23 changes: 23 additions & 0 deletions packages/uiweb/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3618,6 +3618,11 @@ node-gyp-build@^4.2.0, node-gyp-build@^4.3.0:
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e"
integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==

normalize-wheel@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/normalize-wheel/-/normalize-wheel-1.0.1.tgz#aec886affdb045070d856447df62ecf86146ec45"
integrity sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA==

object-inspect@^1.9.0:
version "1.12.3"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9"
Expand Down Expand Up @@ -3816,11 +3821,24 @@ randombytes@^2.1.0:
dependencies:
safe-buffer "^5.1.0"

react-easy-crop@^4.1.4:
version "4.7.5"
resolved "https://registry.yarnpkg.com/react-easy-crop/-/react-easy-crop-4.7.5.tgz#1526827fc83e38b079372310f983bc0517ba6442"
integrity sha512-qKfI4PuhaH1jOLC3DQfQB0cE0z+3N7bfyPkPejQmylXNb8nstfPMH+oHj3gKgpBHLFUiQp/C1rY7sVCVgtjn3Q==
dependencies:
normalize-wheel "^1.0.1"
tslib "2.0.1"

react-icons@^4.10.1:
version "4.10.1"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.10.1.tgz#3f3b5eec1f63c1796f6a26174a1091ca6437a500"
integrity sha512-/ngzDP/77tlCfqthiiGNZeYFACw85fUjZtLbedmJ5DTlNDIwETxhwBzdOJ21zj4iJdvc0J3y7yOsX3PpxAJzrw==

react-image-file-resizer@^0.4.7:
version "0.4.8"
resolved "https://registry.yarnpkg.com/react-image-file-resizer/-/react-image-file-resizer-0.4.8.tgz#85f4ae4469fd2867d961568af660ef403d7a79af"
integrity sha512-Ue7CfKnSlsfJ//SKzxNMz8avDgDSpWQDOnTKOp/GNRFJv4dO9L5YGHNEnj40peWkXXAK2OK0eRIoXhOYpUzUTQ==

[email protected]:
version "2.0.0"
resolved "https://registry.npmjs.org/react-property/-/react-property-2.0.0.tgz"
Expand Down Expand Up @@ -4214,6 +4232,11 @@ [email protected], tslib@^1.9.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

[email protected]:
version "2.0.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e"
integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==

tslib@^2.0.0, tslib@^2.1.0, tslib@^2.3.0:
version "2.5.0"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz"
Expand Down
Loading

0 comments on commit 61979e5

Please sign in to comment.