forked from Mirrors/elk
fix: access headers outside of computed
This commit is contained in:
parent
b9c2bc5c70
commit
73dc060578
1 changed files with 4 additions and 2 deletions
|
@ -27,9 +27,11 @@ export function emojisArrayToObject(emojis: mastodon.v1.CustomEmoji[]) {
|
|||
|
||||
export function noop() {}
|
||||
|
||||
export const useIsMac = () => computed(() =>
|
||||
useRequestHeaders(['user-agent'])['user-agent']?.includes('Macintosh')
|
||||
export const useIsMac = () => {
|
||||
const headers = useRequestHeaders(['user-agent'])
|
||||
return computed(() => headers['user-agent']?.includes('Macintosh')
|
||||
?? navigator?.platform?.includes('Mac') ?? false)
|
||||
}
|
||||
|
||||
export const isEmptyObject = (object: Object) => Object.keys(object).length === 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue