Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(ui): ensure loading messages display correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed May 3, 2020
1 parent 3c8b225 commit ad6e5f5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions renderer/components/Loading/Loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const VARIANTS = {
launchpad: LoadingLaunchpad,
}

const Loading = ({ variant, isLoading }) => {
const Loading = ({ variant, isLoading, ...rest }) => {
const Component = VARIANTS[variant]
if (Component) {
return <Component isLoading={isLoading} />
return <Component isLoading={isLoading} {...rest} />
}

return null
Expand Down
10 changes: 9 additions & 1 deletion renderer/containers/Loading/Loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const LoadingContainer = ({
isAccountPasswordEnabled,
isWalletOpen,
onClose,
message,
isAccountLoading,
isLoggedIn,
}) => {
Expand All @@ -35,7 +36,13 @@ const LoadingContainer = ({
}

return (
<Loading hasClose={hasClose} isLoading={isLoading} onClose={onClose} variant={getVariant()} />
<Loading
hasClose={hasClose}
isLoading={isLoading}
message={message}
onClose={onClose}
variant={getVariant()}
/>
)
}

Expand All @@ -47,6 +54,7 @@ LoadingContainer.propTypes = {
isLoading: PropTypes.bool,
isLoggedIn: PropTypes.bool,
isWalletOpen: PropTypes.bool,
message: PropTypes.object,
onClose: PropTypes.func,
pathname: PropTypes.string.isRequired,
}
Expand Down
2 changes: 1 addition & 1 deletion renderer/containers/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const mapStateToProps = (state, ownProps) => ({
notifications: notificationSelectors.getNotificationState(state),
theme: themeSelectors.currentThemeSettings(state),
isLoading: isLoading(state) || isLoadingPerPath(state, ownProps.history.location),
loadingMessage: getLoadingMessage(state),
loadingMessage: getLoadingMessage(state, ownProps.history.location),
isMounted: appSelectors.isMounted(state),
isAppReady: appSelectors.isAppReady(state),
isRootReady: appSelectors.isRootReady(state),
Expand Down
2 changes: 1 addition & 1 deletion renderer/reducers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const getLoadingMessage = (state, location = {}) => {
}
}

if (pathname === '/app') {
if (pathname === '/app' || pathname === '/onboarding') {
if (!(tickerSelectors.currentTicker(state) && tickerSelectors.cryptoUnitName(state))) {
return fetching_tickers
}
Expand Down

0 comments on commit ad6e5f5

Please sign in to comment.