@lobehub/chat 0.107.15 → 0.108.0

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.
@@ -17,7 +17,7 @@ import { setNamespace } from '@/utils/storeDebug';
17
17
  import { PluginStore } from '../../store';
18
18
  import { PluginDispatch, pluginManifestReducer } from './reducers/manifest';
19
19
 
20
- const t = setNamespace('plugin');
20
+ const n = setNamespace('plugin');
21
21
 
22
22
  /**
23
23
  * 插件接口
@@ -73,7 +73,7 @@ export const createPluginSlice: StateCreator<
73
73
 
74
74
  await installPlugins(plugins);
75
75
 
76
- set({ manifestPrepared: true }, false, t('checkPluginsIsInstalled'));
76
+ set({ manifestPrepared: true }, false, n('checkPluginsIsInstalled'));
77
77
  },
78
78
  deletePluginSettings: (id) => {
79
79
  set(
@@ -81,14 +81,14 @@ export const createPluginSlice: StateCreator<
81
81
  draft.pluginsSettings[id] = undefined;
82
82
  }),
83
83
  false,
84
- t('deletePluginSettings'),
84
+ n('deletePluginSettings'),
85
85
  );
86
86
  },
87
87
  dispatchPluginManifest: (payload) => {
88
88
  const { pluginManifestMap } = get();
89
89
  const nextManifest = pluginManifestReducer(pluginManifestMap, payload);
90
90
 
91
- set({ pluginManifestMap: nextManifest }, false, t('dispatchPluginManifest', payload));
91
+ set({ pluginManifestMap: nextManifest }, false, n('dispatchPluginManifest', payload));
92
92
  },
93
93
  installPlugin: async (name) => {
94
94
  const plugin = pluginSelectors.getPluginMetaById(name)(get());
@@ -140,12 +140,12 @@ export const createPluginSlice: StateCreator<
140
140
  loadPluginStore: async () => {
141
141
  const pluginMarketIndex = await pluginService.getPluginList();
142
142
 
143
- set({ pluginList: pluginMarketIndex.plugins }, false, t('loadPluginList'));
143
+ set({ pluginList: pluginMarketIndex.plugins }, false, n('loadPluginList'));
144
144
 
145
145
  return pluginMarketIndex;
146
146
  },
147
147
  resetPluginSettings: () => {
148
- set({ pluginsSettings: {} }, false, t('resetPluginSettings'));
148
+ set({ pluginsSettings: {} }, false, n('resetPluginSettings'));
149
149
  },
150
150
  updateManifestLoadingState: (key, value) => {
151
151
  set(
@@ -153,7 +153,7 @@ export const createPluginSlice: StateCreator<
153
153
  draft.pluginManifestLoading[key] = value;
154
154
  }),
155
155
  false,
156
- t('updateManifestLoadingState'),
156
+ n('updateManifestLoadingState'),
157
157
  );
158
158
  },
159
159
  updatePluginSettings: (id, settings) => {
@@ -162,7 +162,7 @@ export const createPluginSlice: StateCreator<
162
162
  draft.pluginsSettings[id] = merge({}, draft.pluginsSettings[id], settings);
163
163
  }),
164
164
  false,
165
- t('updatePluginSettings'),
165
+ n('updatePluginSettings'),
166
166
  );
167
167
  },
168
168
 
@@ -18,7 +18,7 @@ import { setNamespace } from '@/utils/storeDebug';
18
18
 
19
19
  import { initLobeSession } from './initialState';
20
20
 
21
- const t = setNamespace('session');
21
+ const n = setNamespace('session');
22
22
 
23
23
  const FETCH_SESSIONS_KEY = 'fetchSessions';
24
24
 
@@ -80,7 +80,7 @@ export const createSessionSlice: StateCreator<
80
80
  SessionAction
81
81
  > = (set, get) => ({
82
82
  activeSession: (sessionId) => {
83
- set({ activeId: sessionId }, false, t('activeSession'));
83
+ set({ activeId: sessionId }, false, n('activeSession'));
84
84
  },
85
85
 
86
86
  clearSessions: async () => {
@@ -153,7 +153,7 @@ export const createSessionSlice: StateCreator<
153
153
  sessions: data,
154
154
  },
155
155
  false,
156
- t('useFetchSessions/onSuccess', data),
156
+ n('useFetchSessions/onSuccess', data),
157
157
  );
158
158
  },
159
159
  }),
@@ -161,7 +161,7 @@ export const createSessionSlice: StateCreator<
161
161
  useSearchSessions: (keyword) =>
162
162
  useSWR<LobeSessions>(keyword, sessionService.searchSessions, {
163
163
  onSuccess: (data) => {
164
- set({ searchSessions: data }, false, t('useSearchSessions(success)', data));
164
+ set({ searchSessions: data }, false, n('useSearchSessions(success)', data));
165
165
  },
166
166
  revalidateOnFocus: false,
167
167
  }),