fix build crash?
This commit is contained in:
parent
c846922baf
commit
f3aba3c4df
15
src/utils.js
15
src/utils.js
@ -80,11 +80,14 @@ export const getShutterFractionFromExposureTime = (exposureTime) => {
|
|||||||
return `${numerator}/${denominator}`;
|
return `${numerator}/${denominator}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getGalleryPageUrl = (
|
export const getGalleryPageUrl = ({ keyword, sortKey }, hash) => {
|
||||||
{ keyword, sortKey },
|
const url = new URL(
|
||||||
hash
|
`${
|
||||||
) => {
|
typeof window !== "undefined"
|
||||||
const url = new URL(`${window?.location.origin ?? 'https://chuckdries.com'}/photogallery/`);
|
? window.location.origin
|
||||||
|
: "https://chuckdries.com"
|
||||||
|
}/photogallery/`
|
||||||
|
);
|
||||||
if (keyword !== undefined) {
|
if (keyword !== undefined) {
|
||||||
if (keyword === null) {
|
if (keyword === null) {
|
||||||
url.searchParams.delete("filter");
|
url.searchParams.delete("filter");
|
||||||
@ -102,5 +105,5 @@ export const getGalleryPageUrl = (
|
|||||||
if (hash) {
|
if (hash) {
|
||||||
url.hash = hash;
|
url.hash = hash;
|
||||||
}
|
}
|
||||||
return url.href.toString().replace(url.origin, '');
|
return url.href.toString().replace(url.origin, "");
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user