Skip to content

Commit

Permalink
Call onChain.getAddress when toggling P2TR support
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjoberg committed May 5, 2022
1 parent 49f4514 commit 9ca98c4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/state/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { IBitcoinUnits } from "../utils/bitcoin-units";
import { MapStyle } from "../utils/google-maps";
import { Chain } from "../utils/build";
import { DEFAULT_INVOICE_EXPIRY } from "../utils/constants";
import { IStoreModel } from "./index";

import {i18n} from "../i18n/i18n"
import { i18n } from "../i18n/i18n";

import logger from "./../utils/log";
const log = logger("Settings");
Expand Down Expand Up @@ -52,7 +53,7 @@ export interface ISettingsModel {
changeLndNoGraphCache: Thunk<ISettingsModel, boolean>;
changeInvoiceExpiry: Thunk<ISettingsModel, number>;
changeRescanWallet: Thunk<ISettingsModel, boolean>;
changeReceiveViaP2TR: Thunk<ISettingsModel, boolean>;
changeReceiveViaP2TR: Thunk<ISettingsModel, boolean, any, IStoreModel>;

setBitcoinUnit: Action<ISettingsModel, keyof IBitcoinUnits>;
setFiatUnit: Action<ISettingsModel, keyof IFiatRates>;
Expand Down Expand Up @@ -310,9 +311,10 @@ export const settings: ISettingsModel = {
actions.setRescanWallet(payload);
}),

changeReceiveViaP2TR: thunk(async (actions, payload) => {
changeReceiveViaP2TR: thunk(async (actions, payload, { getStoreActions }) => {
await setItemObject(StorageItem.receiveViaP2TR, payload);
actions.setReceiveViaP2TR(payload);
await getStoreActions().onChain.getAddress({});
}),

setBitcoinUnit: action((state, payload) => { state.bitcoinUnit = payload; }),
Expand Down

1 comment on commit 9ca98c4

@vercel
Copy link

@vercel vercel bot commented on 9ca98c4 May 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blixt-wallet – ./

blixt-wallet-hsjoberg.vercel.app
blixt-wallet-git-master-hsjoberg.vercel.app

Please sign in to comment.