Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix receive URI handling #3800

Open
wants to merge 7 commits into
base: wallet-switch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions packages/yoroi-extension/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ const WalletSettingsPagePromise = () => import('./containers/settings/categories
const WalletSettingsPage = React.lazy(WalletSettingsPagePromise);
const ExternalStorageSettingsPagePromise = () => import('./containers/settings/categories/ExternalStorageSettingsPage');
const ExternalStorageSettingsPage = React.lazy(ExternalStorageSettingsPagePromise);
const OAuthDropboxPagePromise = () => import('./containers/settings/categories/OAuthDropboxPage');
const OAuthDropboxPage = React.lazy(OAuthDropboxPagePromise);
const TermsOfUseSettingsPagePromise = () => import('./containers/settings/categories/TermsOfUseSettingsPage');
const TermsOfUseSettingsPage = React.lazy(TermsOfUseSettingsPagePromise);
const SupportSettingsPagePromise = () => import('./containers/settings/categories/SupportSettingsPage');
Expand All @@ -85,9 +83,6 @@ const AnalyticsSettingsPage = React.lazy(AnalyticsSettingsPagePromise);
const NightlyPagePromise = () => import('./containers/profile/NightlyPage');
const NightlyPage = React.lazy(NightlyPagePromise);

const MyWalletsPagePromise = () => import('./containers/wallet/MyWalletsPage');
const MyWalletsPage = React.lazy(MyWalletsPagePromise);

const WalletSummaryPagePromise = () => import('./containers/wallet/WalletSummaryPage');
const WalletSummaryPage = React.lazy(WalletSummaryPagePromise);

Expand Down Expand Up @@ -155,11 +150,9 @@ export const LazyLoadPromises: Array<() => any> = [
GeneralSettingsPagePromise,
WalletSettingsPagePromise,
ExternalStorageSettingsPagePromise,
OAuthDropboxPagePromise,
TermsOfUseSettingsPagePromise,
SupportSettingsPagePromise,
NightlyPagePromise,
MyWalletsPagePromise,
WalletSummaryPagePromise,
WalletSendPagePromise,
WalletAssetsPagePromise,
Expand Down Expand Up @@ -226,11 +219,6 @@ export const Routes = (stores: StoresMap): Node => {
path={ROUTES.PROFILE.OPT_FOR_ANALYTICS}
component={props => <OptForAnalyticsPage {...props} stores={stores} />}
/>
<Route
exact
path={ROUTES.MY_WALLETS}
component={props => <MyWalletsPage {...props} stores={stores} />}
/>
<Route exact path={ROUTES.STAKING} component={props => <StakingPage {...props} stores={stores} />} />
<Route
path={ROUTES.ASSETS.ROOT}
Expand Down Expand Up @@ -278,11 +266,6 @@ export const Routes = (stores: StoresMap): Node => {
path={ROUTES.SEND_FROM_URI.ROOT}
component={props => <URILandingPage {...props} stores={stores} />}
/>
<Route
exact
path={ROUTES.OAUTH_FROM_EXTERNAL.DROPBOX}
component={props => <OAuthDropboxPage {...props} stores={stores} />}
/>
<Route exact path={ROUTES.SWITCH} component={props => <WalletSwitch {...props} stores={stores} />} />
<Route
exact
Expand All @@ -304,9 +287,9 @@ export const Routes = (stores: StoresMap): Node => {
path={ROUTES.PORTFOLIO.ROOT}
component={props => wrapPortfolio({ ...props, stores }, PortfolioSubpages(stores))}
/>

<Redirect to={ROUTES.MY_WALLETS} />
</Switch>

<Redirect to={ROUTES.ROOT} />
</Suspense>
</QueryClientProvider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@ import {

export default class ConnectorLoadingStore extends BaseLoadingStore<StoresMap> {

async preLoadingScreenEnd(): Promise<void> {
await super.preLoadingScreenEnd();
async loadingEnd(): Promise<void> {
// fixme ? wait for wallets loading

await this.stores.tokenInfoStore.refreshTokenInfo();
await this.stores.coinPriceStore.loadFromStorage();
}

postLoadingScreenEnd(): void {
super.postLoadingScreenEnd();
}

getTabIdKey(): string {
return TabIdKeys.YoroiConnector;
}
Expand Down
143 changes: 0 additions & 143 deletions packages/yoroi-extension/app/containers/NavBarContainer.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps,
const isRewardWallet = delegation.isRewardWallet(newWalletId);
const isStakingPage = app.currentRoute === ROUTES.STAKING;
await localStorage.unsetPortfolioFiatPair();
this.props.stores.wallets.setActiveWallet({ publicDeriverId: newWalletId });
const route = !isRewardWallet && isStakingPage ? ROUTES.WALLETS.ROOT : app.currentRoute;
this.props.stores.app.goToRoute({ route, publicDeriverId: newWalletId });
this.props.stores.app.goToRoute({ route });
};

checkAndResetGovRoutes: void => void = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ export default class ConnectedWebsitesPageContainer extends Component<StoresProp
};

async componentDidMount() {
// User should not be able to access the route when using Yoroi Light
if (environment.isLight) {
this.props.stores.app.goToRoute({
route: ROUTES.MY_WALLETS,
});
}
await this.props.stores.connector.refreshActiveSites();
await this.props.stores.connector.getConnectorWhitelist();
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ export default class URILandingDialogContainer extends Component<Props> {
<URIInvalidDialog
onClose={this.onCancel}
onSubmit={this.onCancel}
address={
this.props.stores.loading.uriParams
? this.props.stores.loading.uriParams.address
: null
}
address={this.props.stores.loading.uriParams?.address || null}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export default class URILandingPage extends Component<StoresProps> {

onConfirm: void => void = () => {
// this will automatically reroute to the right page if no wallet exists
this.props.stores.app.goToRoute({
route: ROUTES.WALLETS.SEND,
publicDeriverId: this.firstSelectedWalletId(),
});
this.props.stores.app.goToRoute({ route: ROUTES.WALLETS.SEND });
};

render(): Node {
Expand Down
Loading
Loading