summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/renderer/components')
-rw-r--r--gui/src/renderer/components/Accordion.tsx5
-rw-r--r--gui/src/renderer/components/AppButton.tsx7
-rw-r--r--gui/src/renderer/components/Login.tsx7
-rw-r--r--gui/src/renderer/components/NotificationBanner.tsx5
4 files changed, 14 insertions, 10 deletions
diff --git a/gui/src/renderer/components/Accordion.tsx b/gui/src/renderer/components/Accordion.tsx
index 19c9ddee56..cf6603774e 100644
--- a/gui/src/renderer/components/Accordion.tsx
+++ b/gui/src/renderer/components/Accordion.tsx
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Animated, Component, Styles, Types, UserInterface, View } from 'reactxp';
+import consumePromise from '../../shared/promise';
interface IProps {
expanded: boolean;
@@ -56,11 +57,11 @@ export default class Accordion extends Component<IProps, IState> {
if (this.props.expanded && !this.state.mountChildren) {
this.setState({ mountChildren: true });
} else {
- this.animate(this.props.expanded);
+ consumePromise(this.animate(this.props.expanded));
}
} else if (this.state.mountChildren && !oldState.mountChildren) {
// run animations once the children are mounted
- this.animate(this.props.expanded);
+ consumePromise(this.animate(this.props.expanded));
}
}
diff --git a/gui/src/renderer/components/AppButton.tsx b/gui/src/renderer/components/AppButton.tsx
index 8bb11972d1..e1c37c014b 100644
--- a/gui/src/renderer/components/AppButton.tsx
+++ b/gui/src/renderer/components/AppButton.tsx
@@ -2,6 +2,7 @@ import log from 'electron-log';
import * as React from 'react';
import { Button, Component, Styles, Text, Types, UserInterface, View } from 'reactxp';
import { colors } from '../../config.json';
+import consumePromise from '../../shared/promise';
import styles from './AppButtonStyles';
import ImageView from './ImageView';
@@ -94,7 +95,7 @@ class BaseButton extends Component<IProps, IState> {
private textViewRef = React.createRef<PrivateLabel>();
public componentDidMount() {
- this.forceUpdateTextAdjustment();
+ consumePromise(this.forceUpdateTextAdjustment());
}
public render() {
@@ -135,7 +136,7 @@ class BaseButton extends Component<IProps, IState> {
this,
);
- this.updateTextAdjustment(containerLayout);
+ await this.updateTextAdjustment(containerLayout);
}
}
@@ -161,7 +162,7 @@ class BaseButton extends Component<IProps, IState> {
}
private onLayout = (containerLayout: Types.ViewOnLayoutEvent) => {
- this.updateTextAdjustment(containerLayout);
+ consumePromise(this.updateTextAdjustment(containerLayout));
};
}
diff --git a/gui/src/renderer/components/Login.tsx b/gui/src/renderer/components/Login.tsx
index 476aa5cc28..f49054f076 100644
--- a/gui/src/renderer/components/Login.tsx
+++ b/gui/src/renderer/components/Login.tsx
@@ -1,6 +1,7 @@
import * as React from 'react';
import { Animated, Component, Styles, Text, TextInput, Types, UserInterface, View } from 'reactxp';
import { colors, links } from '../../config.json';
+import consumePromise from '../../shared/promise';
import { messages } from '../../shared/gettext';
import Accordion from './Accordion';
import * as AppButton from './AppButton';
@@ -72,7 +73,7 @@ export default class Login extends Component<IProps, IState> {
}
public componentDidMount() {
- this.setFooterVisibility(this.shouldShowFooter());
+ consumePromise(this.setFooterVisibility(this.shouldShowFooter()));
}
public componentDidUpdate(prevProps: IProps, _prevState: IState) {
@@ -91,7 +92,7 @@ export default class Login extends Component<IProps, IState> {
}
this.setLoginButtonActive(this.shouldActivateLoginButton());
- this.setFooterVisibility(this.shouldShowFooter());
+ consumePromise(this.setFooterVisibility(this.shouldShowFooter()));
}
public render() {
@@ -336,7 +337,7 @@ export default class Login extends Component<IProps, IState> {
};
private onRemoveAccountFromHistory = (accountToken: string) => {
- this.removeAccountFromHistory(accountToken);
+ consumePromise(this.removeAccountFromHistory(accountToken));
};
private async removeAccountFromHistory(accountToken: AccountToken) {
diff --git a/gui/src/renderer/components/NotificationBanner.tsx b/gui/src/renderer/components/NotificationBanner.tsx
index ba626c07f4..360c910403 100644
--- a/gui/src/renderer/components/NotificationBanner.tsx
+++ b/gui/src/renderer/components/NotificationBanner.tsx
@@ -1,6 +1,7 @@
import * as React from 'react';
import { Animated, Button, Component, Styles, Text, Types, UserInterface, View } from 'reactxp';
import { colors } from '../../config.json';
+import consumePromise from '../../shared/promise';
import { BlockingButton } from './AppButton';
import ImageView from './ImageView';
@@ -213,7 +214,7 @@ export class NotificationBanner extends Component<
if (prevProps.visible !== this.props.visible) {
// enable drawer-like animation when changing banner's visibility
this.setState({ contentPinnedToBottom: true }, () => {
- this.animateHeightChanges();
+ consumePromise(this.animateHeightChanges());
});
}
}
@@ -249,7 +250,7 @@ export class NotificationBanner extends Component<
// notification banner to slide down each time the component is mounted.
if (this.didFinishFirstLayoutPass) {
if (oldHeight !== height) {
- this.animateHeightChanges();
+ consumePromise(this.animateHeightChanges());
}
} else {
this.didFinishFirstLayoutPass = true;