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

Remove redundant getSettings() calls #2833

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 1 addition & 3 deletions views/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
};

UNSAFE_componentWillMount() {
const { SettingsStore, navigation } = this.props;

SettingsStore.getSettings();
const { navigation } = this.props;

// triggers when loaded from navigation or back action
navigation.addListener('focus', this.handleFocus);
Expand Down
4 changes: 1 addition & 3 deletions views/Settings/Currency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ export default class Currency extends React.Component<
prevState: Readonly<CurrencyState>,
_snapshot?: any
): Promise<void> {
const { SettingsStore } = this.props;
const { getSettings } = SettingsStore;
const settings = await getSettings();
const { settings } = this.props.SettingsStore;
if (prevState.selectedCurrency !== settings.fiat) {
this.setState({
selectedCurrency: settings.fiat
Expand Down
1 change: 0 additions & 1 deletion views/Settings/Security.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export default class Security extends React.Component<
};

componentDidMount() {
this.checkSettings();
this.props.navigation.addListener('focus', this.checkSettings);
}

Expand Down
4 changes: 1 addition & 3 deletions views/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ interface SettingsProps {
@observer
export default class Settings extends React.Component<SettingsProps, {}> {
UNSAFE_componentWillMount() {
const { SettingsStore, navigation } = this.props;

SettingsStore.getSettings();
const { navigation } = this.props;

// triggers when loaded from navigation or back action
navigation.addListener('focus', this.handleFocus);
Expand Down
4 changes: 1 addition & 3 deletions views/Tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ interface ToolsProps {
@observer
export default class Tools extends React.Component<ToolsProps, {}> {
UNSAFE_componentWillMount() {
const { SettingsStore, navigation } = this.props;

SettingsStore.getSettings();
const { navigation } = this.props;

// triggers when loaded from navigation or back action
navigation.addListener('focus', this.handleFocus);
Expand Down