fix build crash?

This commit is contained in:
Chuck Dries 2022-07-10 17:30:51 -07:00
parent c846922baf
commit f3aba3c4df
No known key found for this signature in database
GPG Key ID: A00B7AEAE1DC5BE6

View File

@ -80,11 +80,14 @@ export const getShutterFractionFromExposureTime = (exposureTime) => {
return `${numerator}/${denominator}`;
};
export const getGalleryPageUrl = (
{ keyword, sortKey },
hash
) => {
const url = new URL(`${window?.location.origin ?? 'https://chuckdries.com'}/photogallery/`);
export const getGalleryPageUrl = ({ keyword, sortKey }, hash) => {
const url = new URL(
`${
typeof window !== "undefined"
? window.location.origin
: "https://chuckdries.com"
}/photogallery/`
);
if (keyword !== undefined) {
if (keyword === null) {
url.searchParams.delete("filter");
@ -102,5 +105,5 @@ export const getGalleryPageUrl = (
if (hash) {
url.hash = hash;
}
return url.href.toString().replace(url.origin, '');
return url.href.toString().replace(url.origin, "");
};