fix(bug): memory block bug

This commit is contained in:
Emir Karabeg
2025-02-16 16:22:25 -08:00
parent 2ba9998436
commit 472ea89282
2 changed files with 29 additions and 31 deletions

View File

@@ -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',
},
],
}

View File

@@ -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