Skip to content

Commit

Permalink
fix: ios detection
Browse files Browse the repository at this point in the history
  • Loading branch information
czosel committed Sep 22, 2024
1 parent 4584e3b commit 155c4d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)}`;
Expand Down

0 comments on commit 155c4d7

Please sign in to comment.