mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix(bug): memory block bug
This commit is contained in:
@@ -3,37 +3,33 @@ import { BlockConfig } from '../types'
|
||||
|
||||
export const MemoryBlock: BlockConfig = {
|
||||
type: 'memory',
|
||||
toolbar: {
|
||||
title: 'Memory',
|
||||
description: 'Add memory store',
|
||||
bgColor: '#FF65BF',
|
||||
icon: BrainIcon,
|
||||
category: 'blocks',
|
||||
},
|
||||
name: 'Memory',
|
||||
description: 'Add memory store',
|
||||
bgColor: '#FF65BF',
|
||||
icon: BrainIcon,
|
||||
category: 'blocks',
|
||||
tools: {
|
||||
access: [],
|
||||
},
|
||||
workflow: {
|
||||
inputs: {
|
||||
code: { type: 'string', required: true },
|
||||
timeout: { type: 'number', required: false },
|
||||
memoryLimit: { type: 'number', required: false },
|
||||
},
|
||||
outputs: {
|
||||
response: {
|
||||
type: {
|
||||
result: 'any',
|
||||
stdout: 'string',
|
||||
executionTime: 'number',
|
||||
},
|
||||
},
|
||||
},
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'code',
|
||||
type: 'code',
|
||||
layout: 'full',
|
||||
},
|
||||
],
|
||||
inputs: {
|
||||
code: { type: 'string', required: true },
|
||||
timeout: { type: 'number', required: false },
|
||||
memoryLimit: { type: 'number', required: false },
|
||||
},
|
||||
outputs: {
|
||||
response: {
|
||||
type: {
|
||||
result: 'any',
|
||||
stdout: 'string',
|
||||
executionTime: 'number',
|
||||
},
|
||||
},
|
||||
},
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'code',
|
||||
type: 'code',
|
||||
layout: 'full',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
@@ -10,9 +10,11 @@ import { useWorkflowStore } from './workflow/store'
|
||||
* Reset all application stores to their initial state
|
||||
*/
|
||||
export const resetAllStores = () => {
|
||||
// Clear localStorage first
|
||||
// Selectively clear localStorage items
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.clear()
|
||||
const keysToKeep = ['next-favicon']
|
||||
const keysToRemove = Object.keys(localStorage).filter((key) => !keysToKeep.includes(key))
|
||||
keysToRemove.forEach((key) => localStorage.removeItem(key))
|
||||
}
|
||||
|
||||
// Force immediate state reset for all stores
|
||||
|
||||
Reference in New Issue
Block a user