fix: access headers outside of `computed`
parent
b9c2bc5c70
commit
73dc060578
|
@ -27,9 +27,11 @@ export function emojisArrayToObject(emojis: mastodon.v1.CustomEmoji[]) {
|
||||||
|
|
||||||
export function noop() {}
|
export function noop() {}
|
||||||
|
|
||||||
export const useIsMac = () => computed(() =>
|
export const useIsMac = () => {
|
||||||
useRequestHeaders(['user-agent'])['user-agent']?.includes('Macintosh')
|
const headers = useRequestHeaders(['user-agent'])
|
||||||
|
return computed(() => headers['user-agent']?.includes('Macintosh')
|
||||||
?? navigator?.platform?.includes('Mac') ?? false)
|
?? navigator?.platform?.includes('Mac') ?? false)
|
||||||
|
}
|
||||||
|
|
||||||
export const isEmptyObject = (object: Object) => Object.keys(object).length === 0
|
export const isEmptyObject = (object: Object) => Object.keys(object).length === 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue