Skip to content

Commit

Permalink
fix(project): pre-release fixes
Browse files Browse the repository at this point in the history
- fix date check for live events
- fix error component node container
- fix translations to be parsed by i18n
  • Loading branch information
AntonLantukh committed Jan 11, 2024
1 parent dda841a commit 192a29d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ exports[`<DemoConfigDialog> > renders and matches snapshot error dialog 1`] = `
<p>
demo_note
</p>
<p
<div
class="_links_8c5621"
>
<a
Expand All @@ -134,7 +134,7 @@ exports[`<DemoConfigDialog> > renders and matches snapshot error dialog 1`] = `
Show Stack Trace
</a>
</span>
</p>
</div>
</main>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ErrorPage/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const ErrorPageWithoutTranslation = ({ title, children, message, learnMor
<p className={styles.message}>{message || 'Try refreshing this page or come back later.'}</p>
{children}
{(IS_DEVELOPMENT_BUILD || IS_DEMO_MODE || IS_PREVIEW_MODE) && helpLink && (
<p className={styles.links}>
<div className={styles.links}>
<a href={helpLink} target={'_blank'} rel={'noreferrer'}>
{learnMoreLabel || 'Learn More'}
</a>
Expand All @@ -54,7 +54,7 @@ export const ErrorPageWithoutTranslation = ({ title, children, message, learnMor
<DevStackTrace error={error} />
</span>
)}
</p>
</div>
)}
</>
</main>
Expand Down
4 changes: 2 additions & 2 deletions src/services/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default class ApiService {
};

private parseDate = (item: PlaylistItem, prop: string) => {
const date = item[prop];
const date = item[prop] as string | undefined;

if (date && !isValid(date)) {
if (date && !isValid(new Date(date))) {
console.error(`Invalid "${prop}" date provided for the "${item.title}" media item`);
return undefined;
}
Expand Down
5 changes: 2 additions & 3 deletions src/services/settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ export default class SettingsService {
});

const i18n = getI18n();
const bundle = i18n.getResourceBundle(i18n.language, 'error');

const errorPayload = {
title: bundle['settings_invalid'],
description: bundle['check_your_settings'],
title: i18n.t('error:settings_invalid'),
description: i18n.t('error:check_your_settings'),
helpLink: 'https://github.com/jwplayer/ott-web-app/blob/develop/docs/initialization-file.md',
};

Expand Down

0 comments on commit 192a29d

Please sign in to comment.