@mastra/playground-ui 5.1.10 → 5.1.11-alpha.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.
package/dist/index.es.js CHANGED
@@ -5219,13 +5219,20 @@ function useAgentModelSettingsState({ agentId }) {
5219
5219
  console.error(e);
5220
5220
  }
5221
5221
  }, [LOCAL_STORAGE_KEY]);
5222
- useEffect(() => {
5223
- if (modelSettings) {
5224
- localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify({ modelSettings, chatWithGenerate, agentId }));
5225
- }
5226
- }, [modelSettings, chatWithGenerate, LOCAL_STORAGE_KEY]);
5227
- const setModelSettings = (modelSettingsValue) => setModelSettingsState((prev) => ({ ...prev, ...modelSettingsValue }));
5228
- const setChatWithGenerate = (chatWithGenerateValue) => setChatWithGenerateState(chatWithGenerateValue);
5222
+ const setModelSettings = (modelSettingsValue) => {
5223
+ setModelSettingsState((prev) => ({ ...prev, ...modelSettingsValue }));
5224
+ localStorage.setItem(
5225
+ LOCAL_STORAGE_KEY,
5226
+ JSON.stringify({ modelSettings: modelSettingsValue, chatWithGenerate, agentId })
5227
+ );
5228
+ };
5229
+ const setChatWithGenerate = (chatWithGenerateValue) => {
5230
+ setChatWithGenerateState(chatWithGenerateValue);
5231
+ localStorage.setItem(
5232
+ LOCAL_STORAGE_KEY,
5233
+ JSON.stringify({ modelSettings, chatWithGenerate: chatWithGenerateValue, agentId })
5234
+ );
5235
+ };
5229
5236
  const resetAll = () => {
5230
5237
  setModelSettingsState(defaultModelSettings$1);
5231
5238
  setChatWithGenerate(false);