vueless 0.0.663 → 0.0.664

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.663",
3
+ "version": "0.0.664",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -1,5 +1,5 @@
1
1
  import { vuelessConfig } from "../utils/ui.ts";
2
- import { getRandomId } from "../utils/helper.ts";
2
+ import { getRandomId, isSSR } from "../utils/helper.ts";
3
3
  import {
4
4
  LOCAL_STORAGE_ID,
5
5
  DELAY_BETWEEN_CLONES,
@@ -130,10 +130,14 @@ export function clearNotifications(): void {
130
130
  }
131
131
 
132
132
  export function setDelayedNotify(settings: NotifyConfig): void {
133
+ if (isSSR) return;
134
+
133
135
  localStorage.setItem(LOCAL_STORAGE_ID, JSON.stringify(settings));
134
136
  }
135
137
 
136
138
  export function getDelayedNotify(): void {
139
+ if (isSSR) return;
140
+
137
141
  const notifyData: NotifyConfig | null = JSON.parse(
138
142
  localStorage.getItem(LOCAL_STORAGE_ID) || "null",
139
143
  );
package/utils/theme.ts CHANGED
@@ -50,7 +50,7 @@ export function themeInit() {
50
50
  }
51
51
 
52
52
  export function setColorMode(colorMode: `${ColorMode}`) {
53
- const cashedColorMode = localStorage.getItem(COLOR_MODE_KEY) as ColorMode | null;
53
+ const cashedColorMode = isCSR ? (localStorage.getItem(COLOR_MODE_KEY) as ColorMode | null) : null;
54
54
 
55
55
  const isDark = colorMode === ColorMode.Dark;
56
56
  const isLight = colorMode === ColorMode.Light;