Skip to content

Commit

Permalink
post-merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vsubhuman committed Dec 20, 2024
1 parent f0fb52a commit d62e95e
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export function wrapPortfolio(portfolioProps: StoresProps, children: Node): Node
const currentWalletInfo = createCurrrentWalletInfo(portfolioProps.stores);

const openDialogWrapper = (dialog): void => {
portfolioProps.actions.dialogs.open.trigger({ dialog });
portfolioProps.stores.uiDialogs.open({ dialog });
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class SignTxContainer extends Component<
// will throw a WrongPasswordError if password is wrong
await getPrivateStakingKey({ publicDeriverId: deriver.publicDeriverId, password });
}
await this.props.actions.connector.confirmSignInTx.trigger(password);
await this.props.stores.connector.confirmSignInTx(password);
window.removeEventListener('beforeunload', this.onUnload);
window.removeEventListener('unload', this.onUnload);
window.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps,
};

addNewWallet: void => Promise<void> = async () => {
this.props.actions.dialogs.closeActiveDialog.trigger();
this.props.actions.router.goToRoute.trigger({ route: ROUTES.WALLETS.ADD });
this.props.stores.uiDialogs.closeActiveDialog();
this.props.stores.app.goToRoute({ route: ROUTES.WALLETS.ADD });
await localStorage.unsetPortfolioFiatPair();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default class GeneralSettingsPage extends Component<StoresProps> {
const unitOfAccount = value === 'ADA' ? unitOfAccountDisabledValue : { enabled: true, currency: value };
localStorageApi.unsetPortfolioFiatPair();
await this.props.stores.profile.updateUnitOfAccount(unitOfAccount);
await this.props.stores.transactions.updateUnitOfAccount();
};

render(): Node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ export default class SupportSettingsPage extends Component<StoresProps> {
};

render(): Node {
const { actions } = this.props;
const { stores } = this.props;
return (
<>
{this.getDialog()}
<SupportSettings
onExternalLinkClick={handleExternalLinkClick}
onDownloadLogs={this.handleDownloadLogs}
onPaperWalletTransfer={() => actions.router.redirect.trigger({ route: ROUTES.TRANSFER.ROOT })}
onPaperWalletTransfer={() => stores.app.redirect({ route: ROUTES.TRANSFER.ROOT })}
/>
</>
);
Expand Down
2 changes: 0 additions & 2 deletions packages/yoroi-extension/app/containers/transfer/Transfer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @flow
import type { Node } from 'react';
import type { $npm$ReactIntl$IntlFormat } from 'react-intl';
import type { StoresAndActionsProps } from '../../types/injectedProps.types';
import { Component, lazy, Suspense } from 'react';
import { observer } from 'mobx-react';
import { intlShape } from 'react-intl';
Expand All @@ -12,7 +11,6 @@ import NoWalletMessage from '../wallet/NoWalletMessage';
import NavBarTitle from '../../components/topbar/NavBarTitle';
import globalMessages from '../../i18n/global-messages';
import NavBarContainerRevamp from '../NavBarContainerRevamp';
import HorizontalLine from '../../components/widgets/HorizontalLine';
import type { StoresProps } from '../../stores';

export const WalletTransferPagePromise: void => Promise<any> = () => import('./WalletTransferPage');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Node } from 'react';
import type { StoresAndActionsProps } from '../../types/injectedProps.types';
import { Component } from 'react';
import { observer } from 'mobx-react';
import { getTokenName } from '../../stores/stateless/tokenHelpers';
Expand All @@ -10,14 +9,8 @@ import { intlShape } from 'react-intl';

import TransferTypeSelect from '../../components/transfer/cards/TransferTypeSelect';
import YoroiTransferPage from './YoroiTransferPage';
import { genLookupOrFail, getTokenName, } from '../../stores/stateless/tokenHelpers';
import { truncateToken } from '../../utils/formatters';
import type { StoresProps } from '../../stores';

type Props = {|
publicDeriver: PublicDeriver<>,
|};

@observer
export default class WalletTransferPage extends Component<StoresProps> {
static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default class ChangeWalletPasswordDialogContainer extends Component<{| ..
render(): Node {
const { stores } = this.props;
const { uiDialogs, walletSettings } = stores;
const { updateDataForActiveDialog } = actions.dialogs;
const { changeSigningKeyRequest } = walletSettings;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default class StakingPageContent extends Component<StoresProps, State> {

const handleRewardsWithdrawal = async () => {
if (!isParticipatingToGovernance) {
this.props.actions.dialogs.open.trigger({
this.props.stores.uiDialogs.open({
dialog: GovernanceParticipateDialog,
});
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class ProfileStore extends BaseProfileStore<StoresMap> {
if (this.stores.app.currentRoute === route) {
return;
}
this.actions.router.goToRoute.trigger({ route });
this.stores.app.goToRoute({ route });
},
};

Expand Down
20 changes: 9 additions & 11 deletions packages/yoroi-extension/app/stores/toplevel/TransactionsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,15 @@ export default class TransactionsStore extends Store<StoresMap> {
@observable exportError: ?LocalizableError;
@observable shouldIncludeTxIds: boolean = false;

setup(): void {
this.actions.profile.updateUnitOfAccount.listen(async () => {
const publicDeriver = this.stores.wallets.selected;
if (!publicDeriver) {
return;
}
const timestamps = new Set(this.getTxHistoryState(publicDeriver.publicDeriverId).txs.map(
tx => tx.date.valueOf()
));
await this._updateTransactionPriceData(publicDeriver, timestamps);
});
@action updateUnitOfAccount: void => Promise<void> = async () => {
const publicDeriver = this.stores.wallets.selected;
if (!publicDeriver) {
return;
}
const timestamps = new Set(this.getTxHistoryState(publicDeriver.publicDeriverId).txs.map(
tx => tx.date.valueOf()
));
await this._updateTransactionPriceData(publicDeriver, timestamps);
}

/** Calculate information about transactions that are still realistically reversible */
Expand Down

0 comments on commit d62e95e

Please sign in to comment.