repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import { createSlice, PayloadAction } from '@reduxjs/toolkit'; |
| #2 | |
| #3 | interface DialogState { |
| #4 | updateMemory: { |
| #5 | isOpen: boolean; |
| #6 | memoryId: string | null; |
| #7 | memoryContent: string | null; |
| #8 | }; |
| #9 | } |
| #10 | |
| #11 | interface UIState { |
| #12 | dialogs: DialogState; |
| #13 | } |
| #14 | |
| #15 | const initialState: UIState = { |
| #16 | dialogs: { |
| #17 | updateMemory: { |
| #18 | isOpen: false, |
| #19 | memoryId: null, |
| #20 | memoryContent: null, |
| #21 | }, |
| #22 | }, |
| #23 | }; |
| #24 | |
| #25 | const uiSlice = createSlice({ |
| #26 | name: 'ui', |
| #27 | initialState, |
| #28 | reducers: { |
| #29 | openUpdateMemoryDialog: (state, action: PayloadAction<{ memoryId: string; memoryContent: string }>) => { |
| #30 | state.dialogs.updateMemory.isOpen = true; |
| #31 | state.dialogs.updateMemory.memoryId = action.payload.memoryId; |
| #32 | state.dialogs.updateMemory.memoryContent = action.payload.memoryContent; |
| #33 | }, |
| #34 | closeUpdateMemoryDialog: (state) => { |
| #35 | state.dialogs.updateMemory.isOpen = false; |
| #36 | state.dialogs.updateMemory.memoryId = null; |
| #37 | state.dialogs.updateMemory.memoryContent = null; |
| #38 | }, |
| #39 | }, |
| #40 | }); |
| #41 | |
| #42 | export const { |
| #43 | openUpdateMemoryDialog, |
| #44 | closeUpdateMemoryDialog, |
| #45 | } = uiSlice.actions; |
| #46 | |
| #47 | export default uiSlice.reducer; |