Skip to content

Commit

Permalink
fix(pageMeta): Don't access document in top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
cogk committed Oct 23, 2024
1 parent 3b413c7 commit 4e55352
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/pageMeta.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { watch } from 'vue'

let faviconRef = document.querySelector('link[rel="icon"]')
let defaultFavIcon = faviconRef?.href
let faviconRef = null
let defaultFavIcon = null

export function usePageMeta(fn) {
faviconRef ??= document.querySelector('link[rel="icon"]')
defaultFavIcon ??= faviconRef?.href

watch(
() => {
try {
Expand Down

0 comments on commit 4e55352

Please sign in to comment.