Skip to content

Commit 7bcfb6d

Browse files
committed
Change address bar color
1 parent 554b737 commit 7bcfb6d

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

frontend/src/App.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import {onMounted, ref, computed} from 'vue'
2+
import {onMounted, ref, computed, watch} from 'vue'
33
import {useRoute, useRouter} from 'vue-router'
44
import {useTheme} from 'vuetify'
55
import {useSQLite} from "@/composables/useSQLite.js";
@@ -48,6 +48,21 @@ onMounted(async () => {
4848
await router.replace('/')
4949
})
5050
51+
const updateAddressBar = () => {
52+
const primaryColor = appTheme.current.value.colors.primary
53+
console.log(primaryColor)
54+
let metaTag = document.querySelector('meta[name="theme-color"]')
55+
if (!metaTag) {
56+
metaTag = document.createElement('meta')
57+
metaTag.name = 'theme-color'
58+
document.head.appendChild(metaTag)
59+
}
60+
61+
metaTag.setAttribute('content', primaryColor)
62+
}
63+
64+
watch(() => appTheme.global.name.value, updateAddressBar)
65+
5166
const collectionSettings = ref({})
5267
5368
const fieldIds = {

0 commit comments

Comments
 (0)