Skip to content

Commit

Permalink
fix: access headers outside of computed
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 12, 2023
1 parent b9c2bc5 commit 73dc060
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions composables/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 73dc060

Please sign in to comment.