Skip to content

Commit f70c603

Browse files
committed
fix: remove imports from onPrehydrate
1 parent 2c67363 commit f70c603

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/components/Settings/AccentColorPicker.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<script setup lang="ts">
2-
import { DEFAULT_ACCENT_COLOR_OPTION_ID, useAccentColor } from '~/composables/useSettings'
2+
import { useAccentColor } from '~/composables/useSettings'
33
44
const { accentColors, selectedAccentColorOptionId, setAccentColor } = useAccentColor()
55
66
onPrehydrate(el => {
77
const settings = JSON.parse(localStorage.getItem('npmx-settings') || '{}')
8-
const defaultId = DEFAULT_ACCENT_COLOR_OPTION_ID
8+
// Hardcoded — onPrehydrate is serialized into a <script> tag and cannot reference imports
9+
const defaultId = 'neutral'
910
const id = settings.accentColorId ?? defaultId
1011
if (id) {
1112
const input = el.querySelector<HTMLInputElement>(`input[value="${id}"]`)

app/components/Settings/BgThemePicker.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<script setup lang="ts">
2-
import { DEFAULT_BACKGROUND_THEME_OPTION_ID, useBackgroundTheme } from '~/composables/useSettings'
3-
42
const { backgroundThemes, selectedBackgroundThemeOptionId, setBackgroundTheme } =
53
useBackgroundTheme()
64
75
onPrehydrate(el => {
86
const settings = JSON.parse(localStorage.getItem('npmx-settings') || '{}')
9-
const defaultId = DEFAULT_BACKGROUND_THEME_OPTION_ID
7+
// Hardcoded — onPrehydrate is serialized into a <script> tag and cannot reference imports
8+
const defaultId = 'neutral'
109
const id = settings.preferredBackgroundTheme ?? defaultId
1110
if (id) {
1211
const input = el.querySelector<HTMLInputElement>(`input[value="${id}"]`)

0 commit comments

Comments
 (0)