分离设置页面

This commit is contained in:
IndieKKY
2024-10-04 19:14:01 +08:00
parent 46955e0a59
commit e238d83f78
9 changed files with 96 additions and 66 deletions

View File

@@ -9,9 +9,10 @@ interface EnvState {
tempData: TempData
tempReady: boolean
path?: 'app' | 'options'
fold: boolean // fold app
foldAll?: boolean // fold all segments
page?: string
autoTranslate?: boolean
autoScroll?: boolean
checkAutoScroll?: boolean
@@ -103,6 +104,9 @@ export const slice = createSlice({
setReviewAction: (state, action: PayloadAction<boolean>) => {
state.reviewAction = action.payload
},
setPath: (state, action: PayloadAction<'app' | 'options' | undefined>) => {
state.path = action.payload
},
setTempReady: (state) => {
state.tempReady = true
},
@@ -118,9 +122,6 @@ export const slice = createSlice({
setFoldAll: (state, action: PayloadAction<boolean>) => {
state.foldAll = action.payload
},
setPage: (state, action: PayloadAction<string | undefined>) => {
state.page = action.payload
},
setTotalHeight: (state, action: PayloadAction<number>) => {
state.totalHeight = action.payload
},
@@ -298,6 +299,7 @@ export const slice = createSlice({
})
export const {
setPath,
setUrl,
setTempReady,
setTempData,
@@ -314,7 +316,6 @@ export const {
setTitle,
setSegments,
setLastSummarizeTime,
setPage,
setLastTransTime,
clearTransResults,
addTransResults,