Skip to content

Commit

Permalink
fix: load web home container
Browse files Browse the repository at this point in the history
  • Loading branch information
originalix committed Oct 21, 2023
1 parent fa287c5 commit ee283b4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/kit/src/views/Discover/Controller/gotoSite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export const gotoSite = ({
// TODO: add to history
}

if (webHandler === 'browser') {
return openUrl(validatedUrl);
}
// if (webHandler === 'browser') {
// return openUrl(validatedUrl);
// }

const tabId = tab.id;
const isDeepLink =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';

import { openMatchDApp } from '../Controller/gotoSite';
import DiscoverDashboard from '../Dashboard';
import { openMatchDApp } from '../../Controller/gotoSite';
import DiscoverDashboard from '../../Dashboard';

const WebHomeContainer: FC<{ alwaysOpenNewWindow?: boolean }> = ({
alwaysOpenNewWindow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import useSafeAreaInsets from '@onekeyhq/components/src/Provider/hooks/useSafeAr
import { simpleDb } from '@onekeyhq/kit/src/components/WebView/mock';

import { usePromiseResult } from '../../../../hooks/usePromiseResult';
import { webHandler } from '../../explorerUtils';
import WebHomeContainer from '../Content/WebHomeContainer';
import {
homeTab,
setWebTabsWriteAtom,
useAtomWebTabs,
withProviderWebTabs,
} from '../Context/contextWebTabs';
import { webHandler } from '../../explorerUtils';

import ControllerBarDesktop from './ControllerBarDesktop';
import TabBarDesktop from './TabBarDesktop';
Expand Down Expand Up @@ -59,7 +60,7 @@ function ExplorerDesktop() {
return (
<Stack flex={1} zIndex={3}>
{!showExplorerBar && <ExplorerHeader />}
<Stack>WebView Content</Stack>
<WebHomeContainer />
</Stack>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/views/Discover/explorerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function getWebviewWrapperRef(id?: string) {
let tabId = id;
if (!tabId) {
const { getCurrentTabId } =
require('./Context/contextWebTabs') as typeof import('./Explorer/Context/contextWebTabs');
require('./Explorer/Context/contextWebTabs') as typeof import('./Explorer/Context/contextWebTabs');
tabId = getCurrentTabId();
}
const ref = tabId ? webviewRefs[tabId] : null;
Expand Down

0 comments on commit ee283b4

Please sign in to comment.