@mastra/playground-ui 5.1.10-alpha.1 → 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.cjs.js CHANGED
@@ -5252,13 +5252,20 @@ function useAgentModelSettingsState({ agentId }) {
5252
5252
  console.error(e);
5253
5253
  }
5254
5254
  }, [LOCAL_STORAGE_KEY]);
5255
- React.useEffect(() => {
5256
- if (modelSettings) {
5257
- localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify({ modelSettings, chatWithGenerate, agentId }));
5258
- }
5259
- }, [modelSettings, chatWithGenerate, LOCAL_STORAGE_KEY]);
5260
- const setModelSettings = (modelSettingsValue) => setModelSettingsState((prev) => ({ ...prev, ...modelSettingsValue }));
5261
- const setChatWithGenerate = (chatWithGenerateValue) => setChatWithGenerateState(chatWithGenerateValue);
5255
+ const setModelSettings = (modelSettingsValue) => {
5256
+ setModelSettingsState((prev) => ({ ...prev, ...modelSettingsValue }));
5257
+ localStorage.setItem(
5258
+ LOCAL_STORAGE_KEY,
5259
+ JSON.stringify({ modelSettings: modelSettingsValue, chatWithGenerate, agentId })
5260
+ );
5261
+ };
5262
+ const setChatWithGenerate = (chatWithGenerateValue) => {
5263
+ setChatWithGenerateState(chatWithGenerateValue);
5264
+ localStorage.setItem(
5265
+ LOCAL_STORAGE_KEY,
5266
+ JSON.stringify({ modelSettings, chatWithGenerate: chatWithGenerateValue, agentId })
5267
+ );
5268
+ };
5262
5269
  const resetAll = () => {
5263
5270
  setModelSettingsState(defaultModelSettings$1);
5264
5271
  setChatWithGenerate(false);