Skip to content

Commit

Permalink
add title to ref
Browse files Browse the repository at this point in the history
  • Loading branch information
skylarbarrera committed Apr 9, 2024
1 parent 9a75e24 commit ba5bbab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/components/DappBrowser/BrowserTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ export const BrowserTab = React.memo(function BrowserTab({ tabId, tabIndex, inje
useLayoutEffect(() => {
if (webViewRef.current !== null && isActiveTab) {
activeTabRef.current = webViewRef.current;
if (title.current) {
// @ts-expect-error
activeTabRef.current.title = title.current;
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [activeTabRef, isActiveTab, isOnHomepage, tabId]);
Expand Down
4 changes: 3 additions & 1 deletion src/components/DappBrowser/search-input/AccountIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ export const AccountIcon = () => {
if (actionKey === 'connect') {
if (!isConnected) {
const url = getActiveTabState()?.url;
const name = getDappHost(url);

// @ts-expect-error
const name: string = activeTabRef.current.title || getDappHost(url);

const response = await handleDappBrowserConnectionPrompt({
dappName: name || '',
Expand Down

0 comments on commit ba5bbab

Please sign in to comment.