diff --git a/client/src/lib/model.js b/client/src/lib/model.js index 647b7f5..3733bbf 100644 --- a/client/src/lib/model.js +++ b/client/src/lib/model.js @@ -3,7 +3,7 @@ const asJson = (r) => r.json(); const isBrowser = () => typeof window !== "undefined"; const me = () => isBrowser() && localStorage.getItem("me"); -const isIOS = +const isIOS = () => isBrowser() && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; @@ -21,7 +21,7 @@ export const get = (endpoint) => async (href) => { export const icalHref = (href) => { const origin = API_ORIGIN; // webcal is not supported on Android devices - if (isIOS) { + if (isIOS()) { origin.replace(/https?/, "webcal"); } return `${origin}/team?format=ics&url=${encodeURIComponent(href)}`;