PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.13.0
Code Block Pro – Beautiful Syntax Highlighting v1.13.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
← All changes | src/state/global.ts +2 -12 1.9.21.13.0 View file →
@@ -1,10 +1,8 @@
1 1 import create from 'zustand';
2 2 import { devtools, persist } from 'zustand/middleware';
3 3
4 4 type GlobalTypes = {
5 - seenNotices: string[];
6 - setSeenNotice: (notice: string) => void;
7 5 previousSettings: {
8 6 copyButton: boolean;
9 7 };
10 8 setPreviousSettings: (
@@ -10,22 +8,15 @@
10 8 setPreviousSettings: (
11 9 settings: Partial<GlobalTypes['previousSettings']>,
12 10 ) => void;
13 11 };
12 +
14 13 export const useGlobalStore = create<GlobalTypes>()(
15 14 persist(
16 15 devtools(
17 16 (set) => ({
18 - seenNotices: [],
19 - setSeenNotice(notice: string) {
20 - set((state) => {
21 - if (state.seenNotices.includes(notice)) return state;
22 - return { seenNotices: [...state.seenNotices, notice] };
23 - });
24 - },
25 - // If any of these values have changed, we will use these for defaults.
26 - // Themes and languages are handled separately.
27 17 previousSettings: {
18 + // This should go into settings.tsx and persist to the db
28 19 copyButton: true,
29 20 },
30 21 setPreviousSettings(
31 22 s: Partial<GlobalTypes['previousSettings']>,
@@ -40,9 +31,8 @@
40 31 {
41 32 name: 'code-block-pro-last-globals',
42 33 getStorage: () => localStorage,
43 34 partialize: (state) => ({
44 - seenNotices: state?.seenNotices ?? [],
45 35 previousSettings: state?.previousSettings ?? {},
46 36 }),
47 37 },
48 38 ),