提问优化

This commit is contained in:
IndieKKY
2024-05-27 09:42:04 +08:00
parent be97b1d51a
commit 64059f71e5
3 changed files with 51 additions and 6 deletions

View File

@@ -45,6 +45,11 @@ interface EnvState {
askError?: string
askContent?: string
/**
* 是否输入中(中文)
*/
inputting: boolean
searchText: string
searchResult: Set<number>
}
@@ -71,6 +76,8 @@ const initialState: EnvState = {
data: import.meta.env.VITE_ENV === 'web-dev' ? getDevData() : undefined,
transResults: {},
inputting: false,
searchText: '',
searchResult: new Set(),
}
@@ -288,6 +295,9 @@ export const slice = createSlice({
setFold: (state, action: PayloadAction<boolean>) => {
state.fold = action.payload
},
setInputting: (state, action: PayloadAction<boolean>) => {
state.inputting = action.payload
},
},
})
@@ -335,6 +345,7 @@ export const {
setFold,
setSearchText,
setSearchResult,
setInputting,
} = slice.actions
export default slice.reducer