mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-31 02:26:50 +10:00
Handle show listings error. (Needs refactoring after title is extracted from PageLayout)
This commit is contained in:
parent
d82dc4e1ce
commit
9865fb5762
3 changed files with 7 additions and 6 deletions
|
|
@ -133,13 +133,14 @@ export class ListingPageComponent extends Component {
|
|||
</PageLayout>
|
||||
);
|
||||
|
||||
const loadingPageMsg = {
|
||||
id: 'ListingPage.loadingListingData',
|
||||
defaultMessage: 'Loading listing data',
|
||||
};
|
||||
const loadingPageMsg = { id: 'ListingPage.loadingListingData' };
|
||||
const loadingContent = <PageLayout title={intl.formatMessage(loadingPageMsg)} />;
|
||||
|
||||
return currentListing ? pageContent : loadingContent;
|
||||
const noDataMsg = { id: 'ListingPage.noListingData' };
|
||||
const noDataError = <PageLayout title={intl.formatMessage(noDataMsg)} />;
|
||||
const loadingOrError = entitiesData.showListingsError ? noDataError : loadingContent;
|
||||
|
||||
return currentListing ? pageContent : loadingOrError;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ export const getListingsById = (data, listingIds) => {
|
|||
try {
|
||||
return denormalisedEntities(data.entities, 'listing', listingIds);
|
||||
} catch (e) {
|
||||
console.error(`Could not denormalise entities with given ids (${listingIds.map(id => id.uuid)}). Error: ${e}`);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"HeroSection.subTitle": "The largest online community to rent music studios",
|
||||
"HeroSection.title": "Book Studiotime anywhere",
|
||||
"ListingPage.loadingListingData": "Loading listing data",
|
||||
"ListingPage.noListingData": "Could not find listing data",
|
||||
"PageLayout.authInfoFailed": "Could not get authentication information.",
|
||||
"PageLayout.logoutFailed": "Logout failed. Please try again."
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue