Skip to content

Commit 83e3b93

Browse files
Рустам ОйтовРустам Ойтов
authored andcommitted
Fixes
1 parent bcb2daf commit 83e3b93

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Modules/Sources/PageNavigationFeature/PageNavigationFeature.swift

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct PageNavigationFeature: Reducer, Sendable {
2222

2323
public init() {}
2424

25-
//MARK: - State
25+
// MARK: - State
2626

2727
@ObservableState
2828
public struct State: Equatable {
@@ -31,9 +31,9 @@ public struct PageNavigationFeature: Reducer, Sendable {
3131
@Shared(.appSettings) var appSettings: AppSettings
3232

3333
let type: PageNavigationType
34-
public var page: String = "1"
35-
public var count: Int = 0
36-
public var offset: Int = 0
34+
public var page = "1"
35+
public var count = 0
36+
public var offset = 0
3737
var perPage: Int
3838
public var focus: Field?
3939
public var shouldShow: Bool {
@@ -65,7 +65,7 @@ public struct PageNavigationFeature: Reducer, Sendable {
6565
}
6666
}
6767

68-
//MARK: - Action
68+
// MARK: - Action
6969

7070
public enum Action: BindableAction {
7171
case binding(BindingAction<State>)
@@ -81,7 +81,7 @@ public struct PageNavigationFeature: Reducer, Sendable {
8181
case offsetChanged(to: Int)
8282
}
8383

84-
//MARK: - Body
84+
// MARK: - Body
8585

8686
public var body: some Reducer<State, Action> {
8787
BindingReducer()
@@ -115,15 +115,15 @@ public struct PageNavigationFeature: Reducer, Sendable {
115115

116116
case .firstPageTapped:
117117
state.offset = 0
118-
state.page = "1"
118+
state.page = String(state.currentPage)
119119

120120
case .previousPageTapped:
121121
state.offset -= state.perPage
122-
state.page = "\(state.currentPage)"
122+
state.page = String(state.currentPage)
123123

124124
case .nextPageTapped:
125125
state.offset += state.perPage
126-
state.page = "\(state.currentPage)"
126+
state.page = String(state.currentPage)
127127

128128
case .lastPageTapped:
129129
let targetOffset = state.count - (state.count % state.perPage)
@@ -132,7 +132,7 @@ public struct PageNavigationFeature: Reducer, Sendable {
132132
} else {
133133
state.offset = targetOffset
134134
}
135-
state.page = "\(state.currentPage)"
135+
state.page = String(state.currentPage)
136136

137137
case let .update(count: count, offset: offset):
138138
state.count = count
@@ -147,6 +147,5 @@ public struct PageNavigationFeature: Reducer, Sendable {
147147
await send(.offsetChanged(to: offset))
148148
}
149149
}
150-
// ._printChanges()
151150
}
152151
}

Modules/Sources/PageNavigationFeature/PageNavigationView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public struct PageNavigation: View {
122122
}
123123
.bind($store.focus, to: $focus)
124124
.listRowSeparator(.hidden)
125-
// .animation(.default, value: store.currentPage)
126125
}
127126

128127
// MARK: - Navigation Arrow

Modules/Sources/TopicFeature/TopicScreen.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public struct TopicScreen: View {
5252
}
5353
}
5454
}
55+
.scrollDismissesKeyboard(.immediately)
5556
}
5657
}
5758
.overlay {

0 commit comments

Comments
 (0)