diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2020-04-11 14:36:01 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2020-04-15 12:11:48 +0200 |
| commit | 0f7e814aa66d53fe14b19a39b8d09be0c696fc16 (patch) | |
| tree | 9aea8fe8a7c7aa3e9dd24564a9c641e480cdd90f /gui/src/renderer | |
| parent | c293f478e9328f9b947e4a4b858e8cbf838f75f3 (diff) | |
| download | mullvadvpn-0f7e814aa66d53fe14b19a39b8d09be0c696fc16.tar.xz mullvadvpn-0f7e814aa66d53fe14b19a39b8d09be0c696fc16.zip | |
Update to prettier 2.0.4, bump gettext-extractor and gettext-parser to the latest patch release
Diffstat (limited to 'gui/src/renderer')
18 files changed, 84 insertions, 69 deletions
diff --git a/gui/src/renderer/components/Account.tsx b/gui/src/renderer/components/Account.tsx index 18147ef265..f0cbbe0495 100644 --- a/gui/src/renderer/components/Account.tsx +++ b/gui/src/renderer/components/Account.tsx @@ -30,8 +30,10 @@ export default class Account extends Component<IProps> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> </NavigationItems> </NavigationBar> diff --git a/gui/src/renderer/components/AdvancedSettings.tsx b/gui/src/renderer/components/AdvancedSettings.tsx index 27d4043d7c..d5ffe6e041 100644 --- a/gui/src/renderer/components/AdvancedSettings.tsx +++ b/gui/src/renderer/components/AdvancedSettings.tsx @@ -129,12 +129,16 @@ export default class AdvancedSettings extends Component<IProps> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('advanced-settings-nav', 'Advanced')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('advanced-settings-nav', 'Advanced') + } </TitleBarItem> </NavigationItems> </NavigationBar> @@ -242,13 +246,9 @@ export default class AdvancedSettings extends Component<IProps> { value={this.props.openvpn.port} onSelect={this.onSelectOpenVpnPort} /> - ) : ( - undefined - )} + ) : undefined} </View> - ) : ( - undefined - )} + ) : undefined} {this.props.tunnelProtocol === 'wireguard' ? ( <View style={styles.advanced_settings__content}> @@ -260,9 +260,7 @@ export default class AdvancedSettings extends Component<IProps> { onSelect={this.onSelectWireguardPort} /> </View> - ) : ( - undefined - )} + ) : undefined} <Selector title={ diff --git a/gui/src/renderer/components/ErrorBoundary.tsx b/gui/src/renderer/components/ErrorBoundary.tsx index 443eb6943a..18ac8f7d03 100644 --- a/gui/src/renderer/components/ErrorBoundary.tsx +++ b/gui/src/renderer/components/ErrorBoundary.tsx @@ -55,8 +55,9 @@ export default class ErrorBoundary extends Component<IProps, IState> { this.setState({ hasError: true }); log.error( - `The error boundary caught an error: ${error.message}\nError stack: ${error.stack || - 'Not available'}\nComponent stack: ${info.componentStack}`, + `The error boundary caught an error: ${error.message}\nError stack: ${ + error.stack || 'Not available' + }\nComponent stack: ${info.componentStack}`, ); } diff --git a/gui/src/renderer/components/NotificationArea.tsx b/gui/src/renderer/components/NotificationArea.tsx index 678341f079..812e686f69 100644 --- a/gui/src/renderer/components/NotificationArea.tsx +++ b/gui/src/renderer/components/NotificationArea.tsx @@ -183,14 +183,7 @@ export default class NotificationArea extends Component<IProps, State> { }; } - if ( - accountExpiry && - accountExpiry.willHaveExpiredAt( - moment() - .add(3, 'days') - .toDate(), - ) - ) { + if (accountExpiry && accountExpiry.willHaveExpiredAt(moment().add(3, 'days').toDate())) { return { visible: true, type: 'expires-soon', diff --git a/gui/src/renderer/components/Preferences.tsx b/gui/src/renderer/components/Preferences.tsx index 54d492ce7e..dc80143fc9 100644 --- a/gui/src/renderer/components/Preferences.tsx +++ b/gui/src/renderer/components/Preferences.tsx @@ -43,12 +43,16 @@ export default class Preferences extends Component<IProps> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('preferences-nav', 'Preferences')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('preferences-nav', 'Preferences') + } </TitleBarItem> </NavigationItems> </NavigationBar> @@ -159,9 +163,7 @@ export default class Preferences extends Component<IProps> { </Cell.FooterText> </Cell.Footer> </React.Fragment> - ) : ( - undefined - )} + ) : undefined} <Cell.Container> <Cell.Label> diff --git a/gui/src/renderer/components/SelectLanguage.tsx b/gui/src/renderer/components/SelectLanguage.tsx index 7af49d76a8..254272cc46 100644 --- a/gui/src/renderer/components/SelectLanguage.tsx +++ b/gui/src/renderer/components/SelectLanguage.tsx @@ -71,12 +71,16 @@ export default class SelectLanguage extends Component<IProps, IState> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('select-language-nav', 'Select language')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('select-language-nav', 'Select language') + } </TitleBarItem> </NavigationItems> </NavigationBar> diff --git a/gui/src/renderer/components/SelectLocation.tsx b/gui/src/renderer/components/SelectLocation.tsx index 68ca5db8db..8ea980a5ae 100644 --- a/gui/src/renderer/components/SelectLocation.tsx +++ b/gui/src/renderer/components/SelectLocation.tsx @@ -93,8 +93,10 @@ export default class SelectLocation extends Component<IProps> { <NavigationItems> <CloseBarItem action={this.props.onClose} /> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('select-location-nav', 'Select location')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('select-location-nav', 'Select location') + } </TitleBarItem> </NavigationItems> <View style={styles.navigationBarAttachment}> diff --git a/gui/src/renderer/components/Settings.tsx b/gui/src/renderer/components/Settings.tsx index f1e1893646..eb12187dc9 100644 --- a/gui/src/renderer/components/Settings.tsx +++ b/gui/src/renderer/components/Settings.tsx @@ -51,8 +51,10 @@ export default class Settings extends Component<IProps> { <NavigationItems> <CloseBarItem action={this.props.onClose} /> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </TitleBarItem> </NavigationItems> </NavigationBar> @@ -113,8 +115,10 @@ export default class Settings extends Component<IProps> { <View> <Cell.CellButton onPress={this.props.onViewAccount}> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Account' view - messages.pgettext('settings-view', 'Account')} + { + // TRANSLATORS: Navigation button to the 'Account' view + messages.pgettext('settings-view', 'Account') + } </Cell.Label> <Cell.SubText style={isOutOfTime ? styles.accountPaidUntilErrorLabel : undefined}> {isOutOfTime ? outOfTimeMessage : formattedExpiry} @@ -125,16 +129,20 @@ export default class Settings extends Component<IProps> { <Cell.CellButton onPress={this.props.onViewPreferences}> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Preferences' view - messages.pgettext('settings-view', 'Preferences')} + { + // TRANSLATORS: Navigation button to the 'Preferences' view + messages.pgettext('settings-view', 'Preferences') + } </Cell.Label> <Cell.Icon height={12} width={7} source="icon-chevron" /> </Cell.CellButton> <Cell.CellButton onPress={this.props.onViewAdvancedSettings}> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Advanced' settings view - messages.pgettext('settings-view', 'Advanced')} + { + // TRANSLATORS: Navigation button to the 'Advanced' settings view + messages.pgettext('settings-view', 'Advanced') + } </Cell.Label> <Cell.Icon height={12} width={7} source="icon-chevron" /> </Cell.CellButton> @@ -189,16 +197,20 @@ export default class Settings extends Component<IProps> { <View> <Cell.CellButton onPress={this.props.onViewSupport}> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Report a problem' help view - messages.pgettext('settings-view', 'Report a problem')} + { + // TRANSLATORS: Navigation button to the 'Report a problem' help view + messages.pgettext('settings-view', 'Report a problem') + } </Cell.Label> <Cell.Icon height={12} width={7} source="icon-chevron" /> </Cell.CellButton> <Cell.CellButton disabled={this.props.isOffline} onPress={this.openFaqLink}> <Cell.Label> - {// TRANSLATORS: Link to the webpage - messages.pgettext('settings-view', 'FAQs & Guides')} + { + // TRANSLATORS: Link to the webpage + messages.pgettext('settings-view', 'FAQs & Guides') + } </Cell.Label> <Cell.Icon height={16} width={16} source="icon-extLink" /> </Cell.CellButton> @@ -206,8 +218,10 @@ export default class Settings extends Component<IProps> { <Cell.CellButton onPress={this.props.onViewSelectLanguage}> <Cell.UntintedIcon width={24} height={24} source="icon-language" /> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Language' settings view - messages.pgettext('settings-view', 'Language')} + { + // TRANSLATORS: Navigation button to the 'Language' settings view + messages.pgettext('settings-view', 'Language') + } </Cell.Label> <Cell.SubText>{this.props.preferredLocaleDisplayName}</Cell.SubText> <Cell.Icon height={12} width={7} source="icon-chevron" /> diff --git a/gui/src/renderer/components/Support.tsx b/gui/src/renderer/components/Support.tsx index 18ef6627ac..5f9a6db8a4 100644 --- a/gui/src/renderer/components/Support.tsx +++ b/gui/src/renderer/components/Support.tsx @@ -136,8 +136,10 @@ export default class Support extends Component<ISupportProps, ISupportState> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> </NavigationItems> </NavigationBar> diff --git a/gui/src/renderer/components/WireguardKeys.tsx b/gui/src/renderer/components/WireguardKeys.tsx index 2a589890e7..2f17ff19bc 100644 --- a/gui/src/renderer/components/WireguardKeys.tsx +++ b/gui/src/renderer/components/WireguardKeys.tsx @@ -63,8 +63,10 @@ export default class WireguardKeys extends Component<IProps, IState> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('wireguard-keys-nav', 'Advanced')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('wireguard-keys-nav', 'Advanced') + } </BackBarItem> </NavigationItems> </NavigationBar> diff --git a/gui/src/renderer/containers/SelectLocationPage.tsx b/gui/src/renderer/containers/SelectLocationPage.tsx index c52dd4fd31..2c0d29c8ee 100644 --- a/gui/src/renderer/containers/SelectLocationPage.tsx +++ b/gui/src/renderer/containers/SelectLocationPage.tsx @@ -54,9 +54,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: IAppContext) => { history.goBack(); try { - const relayUpdate = RelaySettingsBuilder.normal() - .location.fromRaw(relayLocation) - .build(); + const relayUpdate = RelaySettingsBuilder.normal().location.fromRaw(relayLocation).build(); await props.app.updateRelaySettings(relayUpdate); await props.app.connectTunnel(); diff --git a/gui/src/renderer/lib/account.ts b/gui/src/renderer/lib/account.ts index c862d84416..0909b9670b 100644 --- a/gui/src/renderer/lib/account.ts +++ b/gui/src/renderer/lib/account.ts @@ -1,8 +1,5 @@ export function formatAccountToken(accountToken: string) { const parts = - accountToken - .replace(/\s+| /g, '') - .substring(0, 16) - .match(new RegExp('.{1,4}', 'g')) || []; + accountToken.replace(/\s+| /g, '').substring(0, 16).match(new RegExp('.{1,4}', 'g')) || []; return parts.join(' '); } diff --git a/gui/src/renderer/redux/account/reducers.ts b/gui/src/renderer/redux/account/reducers.ts index f429192de5..bf2a87c6b5 100644 --- a/gui/src/renderer/redux/account/reducers.ts +++ b/gui/src/renderer/redux/account/reducers.ts @@ -20,7 +20,7 @@ const initialState: IAccountReduxState = { status: { type: 'none' }, }; -export default function( +export default function ( state: IAccountReduxState = initialState, action: ReduxAction, ): IAccountReduxState { diff --git a/gui/src/renderer/redux/connection/reducers.ts b/gui/src/renderer/redux/connection/reducers.ts index e7f2f0c2cf..48a8f3f37f 100644 --- a/gui/src/renderer/redux/connection/reducers.ts +++ b/gui/src/renderer/redux/connection/reducers.ts @@ -27,7 +27,7 @@ const initialState: IConnectionReduxState = { city: undefined, }; -export default function( +export default function ( state: IConnectionReduxState = initialState, action: ReduxAction, ): IConnectionReduxState { diff --git a/gui/src/renderer/redux/settings/reducers.ts b/gui/src/renderer/redux/settings/reducers.ts index d74cbd3b4f..3cfb414a42 100644 --- a/gui/src/renderer/redux/settings/reducers.ts +++ b/gui/src/renderer/redux/settings/reducers.ts @@ -175,7 +175,7 @@ const initialState: ISettingsReduxState = { }, }; -export default function( +export default function ( state: ISettingsReduxState = initialState, action: ReduxAction, ): ISettingsReduxState { diff --git a/gui/src/renderer/redux/support/reducers.ts b/gui/src/renderer/redux/support/reducers.ts index 7a300cf2ca..94ed2a9123 100644 --- a/gui/src/renderer/redux/support/reducers.ts +++ b/gui/src/renderer/redux/support/reducers.ts @@ -10,7 +10,7 @@ const initialState: ISupportReduxState = { message: '', }; -export default function( +export default function ( state: ISupportReduxState = initialState, action: ReduxAction, ): ISupportReduxState { diff --git a/gui/src/renderer/redux/userinterface/reducers.ts b/gui/src/renderer/redux/userinterface/reducers.ts index 7941d6001b..62231aafaf 100644 --- a/gui/src/renderer/redux/userinterface/reducers.ts +++ b/gui/src/renderer/redux/userinterface/reducers.ts @@ -18,7 +18,7 @@ const initialState: IUserInterfaceReduxState = { locationScope: LocationScope.relay, }; -export default function( +export default function ( state: IUserInterfaceReduxState = initialState, action: ReduxAction, ): IUserInterfaceReduxState { diff --git a/gui/src/renderer/redux/version/reducers.ts b/gui/src/renderer/redux/version/reducers.ts index 21de2bf2d8..9932628e02 100644 --- a/gui/src/renderer/redux/version/reducers.ts +++ b/gui/src/renderer/redux/version/reducers.ts @@ -18,7 +18,7 @@ const initialState: IVersionReduxState = { consistent: true, }; -export default function( +export default function ( state: IVersionReduxState = initialState, action: ReduxAction, ): IVersionReduxState { |
