mirror of
https://github.com/ManInDark/HabitTrove.git
synced 2026-03-10 04:19:49 +01:00
Compare commits
1 Commits
client-hel
...
dependency
| Author | SHA1 | Date | |
|---|---|---|---|
|
dbd0d0c7b7
|
@@ -1,8 +1,9 @@
|
|||||||
// client helpers
|
// client helpers
|
||||||
'use-client'
|
'use-client'
|
||||||
|
|
||||||
import { useAtom } from 'jotai'
|
|
||||||
import { useSession } from "next-auth/react"
|
import { useSession } from "next-auth/react"
|
||||||
|
import { User, UserId } from './types'
|
||||||
|
import { useAtom } from 'jotai'
|
||||||
import { usersAtom } from './atoms'
|
import { usersAtom } from './atoms'
|
||||||
import { checkPermission } from './utils'
|
import { checkPermission } from './utils'
|
||||||
|
|
||||||
@@ -13,7 +14,7 @@ export function useHelpers() {
|
|||||||
const currentUser = usersData.users.find((u) => u.id === currentUserId)
|
const currentUser = usersData.users.find((u) => u.id === currentUserId)
|
||||||
// detect iOS: https://stackoverflow.com/a/9039885
|
// detect iOS: https://stackoverflow.com/a/9039885
|
||||||
function iOS() {
|
function iOS() {
|
||||||
return typeof navigator !== "undefined" && ([
|
return [
|
||||||
'iPad Simulator',
|
'iPad Simulator',
|
||||||
'iPhone Simulator',
|
'iPhone Simulator',
|
||||||
'iPod Simulator',
|
'iPod Simulator',
|
||||||
@@ -22,7 +23,7 @@ export function useHelpers() {
|
|||||||
'iPod',
|
'iPod',
|
||||||
].includes(navigator.platform)
|
].includes(navigator.platform)
|
||||||
// iPad on iOS 13 detection
|
// iPad on iOS 13 detection
|
||||||
|| (navigator.userAgent.includes("Mac") && "ontouchend" in document))
|
|| (navigator.userAgent.includes("Mac") && "ontouchend" in document)
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
"js-confetti": "^0.12.0",
|
"js-confetti": "^0.12.0",
|
||||||
"linkify": "^0.2.1",
|
"linkify": "^0.2.1",
|
||||||
"linkify-react": "^4.2.0",
|
"linkify-react": "^4.2.0",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"lucide-react": "^0.469.0",
|
"lucide-react": "^0.469.0",
|
||||||
"luxon": "^3.5.0",
|
"luxon": "^3.5.0",
|
||||||
"next": "15.2.3",
|
"next": "15.2.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user