fix: app crash on qutebrowser
add a prop in numberformat options that was resulting in out of range error. also swapped 'replaceAll' with 'replace' https://github.com/zyachel/libremdb/issues/24
This commit is contained in:
parent
c2df20e6ad
commit
78b14ec079
@ -124,10 +124,7 @@ const Info = ({ info, className, router }: Props) => {
|
|||||||
{keywords.list.map(word => (
|
{keywords.list.map(word => (
|
||||||
<li className={styles.keywords__item} key={word}>
|
<li className={styles.keywords__item} key={word}>
|
||||||
<Link
|
<Link
|
||||||
href={`/search/keyword/?keywords=${word.replaceAll(
|
href={`/search/keyword/?keywords=${word.replace(/\s/g,'-')}`}
|
||||||
' ',
|
|
||||||
'-'
|
|
||||||
)}`}
|
|
||||||
>
|
>
|
||||||
<a className='link'>{word}</a>
|
<a className='link'>{word}</a>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -46,16 +46,17 @@ export const formatMoney = (num: number, cur: string) => {
|
|||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: cur,
|
currency: cur,
|
||||||
maximumFractionDigits: 0,
|
maximumFractionDigits: 0,
|
||||||
|
minimumFractionDigits: 0,
|
||||||
}).format(num);
|
}).format(num);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const modifyIMDbImg = (url: string, widthInPx = 600) => {
|
export const modifyIMDbImg = (url: string, widthInPx = 600) => {
|
||||||
return url.replaceAll('.jpg', `UX${widthInPx}.jpg`);
|
return url.replace(/\.jpg/g, `UX${widthInPx}.jpg`);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getProxiedIMDbImgUrl = (url: string) => {
|
export const getProxiedIMDbImgUrl = (url: string) => {
|
||||||
return `/api/media_proxy?url=${encodeURIComponent(url)}`;
|
return `/api/media_proxy?url=${encodeURIComponent(url)}`;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const AppError = class extends Error {
|
export const AppError = class extends Error {
|
||||||
constructor(message: string, public statusCode: number, cause?: any) {
|
constructor(message: string, public statusCode: number, cause?: any) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user