refactor: update color modes handling

This commit is contained in:
mrholek
2023-06-30 13:10:03 +02:00
parent 8a7baa6670
commit afadc178f2
+3 -2
View File
@@ -15,8 +15,9 @@ export default {
onBeforeMount(() => {
const urlParams = new URLSearchParams(window.location.href.split('?')[1])
if (urlParams.get('theme')) {
setColorMode(urlParams.get('theme'))
const theme = urlParams.get('theme').match(/^[A-Za-z0-9\s]+/)[0]
if (theme) {
setColorMode(theme)
return
}