diff --git a/src/components/util/PresetUtils.ts b/src/components/util/PresetUtils.ts index 854e6ae5..40f6befe 100644 --- a/src/components/util/PresetUtils.ts +++ b/src/components/util/PresetUtils.ts @@ -7,6 +7,10 @@ export interface format { strikethrough?: string; } +export const defaultPresets = { + savedPresets: [], +} + export const presets = [ { version: 4, diff --git a/src/components/util/SharedUtils.ts b/src/components/util/SharedUtils.ts index 4a327ed1..9199f468 100644 --- a/src/components/util/SharedUtils.ts +++ b/src/components/util/SharedUtils.ts @@ -1,7 +1,7 @@ import type { Cookie } from '@builder.io/qwik-city'; import { rgbDefaults } from '~/routes/resources/rgb'; import { animTABDefaults } from '~/routes/resources/animtab'; -import { defaults, loadPreset } from './PresetUtils'; +import { defaults, loadPreset, defaultPresets } from './PresetUtils'; type names = 'rgb' | 'animtab' | 'parsed' | 'animpreview' | 'presets'; @@ -17,6 +17,8 @@ export function getCookies(cookie: Cookie, preset: names, urlParams?: URLSearchP json = JSON.parse(decodeURIComponent(cookieVal)); // Decode the cookie value } else if (preset == 'rgb' || preset == 'animtab') { json = preset == 'rgb' ? deepclone(rgbDefaults) : deepclone(animTABDefaults); + } else if (preset == 'presets') { + json = deepclone(defaultPresets); } else { json = {}; }