Skip to content

Commit

Permalink
Migrate TCA to 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
chihchy committed Jul 10, 2024
1 parent 8acab4d commit 9a02e11
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion EhPanda.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,7 @@
repositoryURL = "https://github.com/pointfreeco/swift-composable-architecture.git";
requirement = {
kind = exactVersion;
version = 1.4.2;
version = 1.5.6;
};
};
ABAC82FC26BC4866009F5026 /* XCRemoteSwiftPackageReference "SwiftyOpenCC" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-composable-architecture.git",
"state" : {
"revision" : "eddc1869b37ce42e3b34e72b1e1355d049e73970",
"version" : "1.4.2"
"revision" : "3568f01377c6c668aad40d066acf97ce670a1dad",
"version" : "1.5.6"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/App/EhPandaApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ComposableArchitecture
MigrationView(
store: appDelegate.store.scope(
state: \.appDelegateState.migrationState,
action: { AppReducer.Action.appDelegate(.migration($0)) }
action: \.appDelegate.migration
)
)
.opacity(viewStore.state != .idle ? 1 : 0)
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/View/Detail/Comments/CommentsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private extension CommentsView {
@ViewBuilder var navigationLink: some View {
NavigationLink(unwrapping: viewStore.$route, case: /CommentsReducer.Route.detail) { route in
DetailView(
store: store.scope(state: \.detailState, action: CommentsReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand Down
8 changes: 4 additions & 4 deletions EhPanda/View/Detail/DetailSearch/DetailSearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct DetailSearchView: View {
)
.sheet(unwrapping: viewStore.$route, case: /DetailSearchReducer.Route.quickSearch) { _ in
QuickSearchView(
store: store.scope(state: \.quickDetailSearchState, action: DetailSearchReducer.Action.quickSearch)
store: store.scope(state: \.quickDetailSearchState, action: \.quickSearch)
) { keyword in
viewStore.send(.setNavigation(nil))
viewStore.send(.fetchGalleries(keyword))
Expand All @@ -56,7 +56,7 @@ struct DetailSearchView: View {
.autoBlur(radius: blurRadius)
}
.sheet(unwrapping: viewStore.$route, case: /DetailSearchReducer.Route.filters) { _ in
FiltersView(store: store.scope(state: \.filtersState, action: DetailSearchReducer.Action.filters))
FiltersView(store: store.scope(state: \.filtersState, action: \.filters))
.accentColor(setting.accentColor).autoBlur(radius: blurRadius)
}
.searchable(text: viewStore.$keyword)
Expand Down Expand Up @@ -85,7 +85,7 @@ struct DetailSearchView: View {
.sheet(unwrapping: viewStore.$route, case: /DetailSearchReducer.Route.detail) { route in
NavigationView {
DetailView(
store: store.scope(state: \.detailState, action: DetailSearchReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand All @@ -101,7 +101,7 @@ struct DetailSearchView: View {
if DeviceUtil.isPhone {
NavigationLink(unwrapping: viewStore.$route, case: /DetailSearchReducer.Route.detail) { route in
DetailView(
store: store.scope(state: \.detailState, action: DetailSearchReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand Down
14 changes: 7 additions & 7 deletions EhPanda/View/Detail/DetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct DetailView: View {
}
.fullScreenCover(unwrapping: viewStore.$route, case: /DetailReducer.Route.reading) { _ in
ReadingView(
store: store.scope(state: \.readingState, action: DetailReducer.Action.reading),
store: store.scope(state: \.readingState, action: \.reading),
gid: gid, setting: $setting, blurRadius: blurRadius
)
.accentColor(setting.accentColor)
Expand All @@ -132,15 +132,15 @@ struct DetailView: View {
.sheet(unwrapping: viewStore.$route, case: /DetailReducer.Route.archives) { route in
let (galleryURL, archiveURL) = route.wrappedValue
ArchivesView(
store: store.scope(state: \.archivesState, action: DetailReducer.Action.archives),
store: store.scope(state: \.archivesState, action: \.archives),
gid: gid, user: user, galleryURL: galleryURL, archiveURL: archiveURL
)
.accentColor(setting.accentColor)
.autoBlur(radius: blurRadius)
}
.sheet(unwrapping: viewStore.$route, case: /DetailReducer.Route.torrents) { _ in
TorrentsView(
store: store.scope(state: \.torrentsState, action: DetailReducer.Action.torrents),
store: store.scope(state: \.torrentsState, action: \.torrents),
gid: gid, token: viewStore.gallery.token, blurRadius: blurRadius
)
.accentColor(setting.accentColor)
Expand Down Expand Up @@ -191,12 +191,12 @@ private extension DetailView {
@ViewBuilder var navigationLinks: some View {
NavigationLink(unwrapping: viewStore.$route, case: /DetailReducer.Route.previews) { _ in
PreviewsView(
store: store.scope(state: \.previewsState, action: DetailReducer.Action.previews),
store: store.scope(state: \.previewsState, action: \.previews),
gid: gid, setting: $setting, blurRadius: blurRadius
)
}
NavigationLink(unwrapping: viewStore.$route, case: /DetailReducer.Route.comments) { route in
IfLetStore(store.scope(state: \.commentsState, action: DetailReducer.Action.comments)) { store in
IfLetStore(store.scope(state: \.commentsState, action: \.comments)) { store in
CommentsView(
store: store, gid: gid, token: viewStore.gallery.token, apiKey: viewStore.apiKey,
galleryURL: route.wrappedValue, comments: viewStore.galleryComments, user: user,
Expand All @@ -206,7 +206,7 @@ private extension DetailView {
}
}
NavigationLink(unwrapping: viewStore.$route, case: /DetailReducer.Route.detailSearch) { route in
IfLetStore(store.scope(state: \.detailSearchState, action: DetailReducer.Action.detailSearch)) { store in
IfLetStore(store.scope(state: \.detailSearchState, action: \.detailSearch)) { store in
DetailSearchView(
store: store, keyword: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
Expand All @@ -216,7 +216,7 @@ private extension DetailView {
NavigationLink(unwrapping: viewStore.$route, case: /DetailReducer.Route.galleryInfos) { route in
let (gallery, galleryDetail) = route.wrappedValue
GalleryInfosView(
store: store.scope(state: \.galleryInfosState, action: DetailReducer.Action.galleryInfos),
store: store.scope(state: \.galleryInfosState, action: \.galleryInfos),
gallery: gallery, galleryDetail: galleryDetail
)
}
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/View/Detail/Previews/PreviewsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct PreviewsView: View {
}
.fullScreenCover(unwrapping: viewStore.$route, case: /PreviewsReducer.Route.reading) { _ in
ReadingView(
store: store.scope(state: \.readingState, action: PreviewsReducer.Action.reading),
store: store.scope(state: \.readingState, action: \.reading),
gid: gid, setting: $setting, blurRadius: blurRadius
)
.accentColor(setting.accentColor)
Expand Down
6 changes: 3 additions & 3 deletions EhPanda/View/Favorites/FavoritesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct FavoritesView: View {
}
.sheet(unwrapping: viewStore.$route, case: /FavoritesReducer.Route.quickSearch) { _ in
QuickSearchView(
store: store.scope(state: \.quickSearchState, action: FavoritesReducer.Action.quickSearch)
store: store.scope(state: \.quickSearchState, action: \.quickSearch)
) { keyword in
viewStore.send(.setNavigation(nil))
viewStore.send(.fetchGalleries(keyword))
Expand Down Expand Up @@ -92,7 +92,7 @@ struct FavoritesView: View {
.sheet(unwrapping: viewStore.$route, case: /FavoritesReducer.Route.detail) { route in
NavigationView {
DetailView(
store: store.scope(state: \.detailState, action: FavoritesReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand All @@ -109,7 +109,7 @@ struct FavoritesView: View {
if DeviceUtil.isPhone {
NavigationLink(unwrapping: viewStore.$route, case: /FavoritesReducer.Route.detail) { route in
DetailView(
store: store.scope(state: \.detailState, action: FavoritesReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand Down
6 changes: 3 additions & 3 deletions EhPanda/View/Home/Frontpage/FrontpageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct FrontpageView: View {
}
)
.sheet(unwrapping: viewStore.$route, case: /FrontpageReducer.Route.filters) { _ in
FiltersView(store: store.scope(state: \.filtersState, action: FrontpageReducer.Action.filters))
FiltersView(store: store.scope(state: \.filtersState, action: \.filters))
.autoBlur(radius: blurRadius).environment(\.inSheet, true)
}
.searchable(text: viewStore.$keyword, prompt: L10n.Localizable.Searchable.Prompt.filter)
Expand All @@ -65,7 +65,7 @@ struct FrontpageView: View {
.sheet(unwrapping: viewStore.$route, case: /FrontpageReducer.Route.detail) { route in
NavigationView {
DetailView(
store: store.scope(state: \.detailState, action: FrontpageReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand All @@ -81,7 +81,7 @@ struct FrontpageView: View {
if DeviceUtil.isPhone {
NavigationLink(unwrapping: viewStore.$route, case: /FrontpageReducer.Route.detail) { route in
DetailView(
store: store.scope(state: \.detailState, action: FrontpageReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand Down
4 changes: 2 additions & 2 deletions EhPanda/View/Home/History/HistoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct HistoryView: View {
.sheet(unwrapping: viewStore.$route, case: /HistoryReducer.Route.detail) { route in
NavigationView {
DetailView(
store: store.scope(state: \.detailState, action: HistoryReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand All @@ -75,7 +75,7 @@ struct HistoryView: View {
if DeviceUtil.isPhone {
NavigationLink(unwrapping: viewStore.$route, case: /HistoryReducer.Route.detail) { route in
DetailView(
store: store.scope(state: \.detailState, action: HistoryReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand Down
14 changes: 7 additions & 7 deletions EhPanda/View/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ struct HomeView: View {
.sheet(unwrapping: viewStore.$route, case: /HomeReducer.Route.detail) { route in
NavigationView {
DetailView(
store: store.scope(state: \.detailState, action: HomeReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand Down Expand Up @@ -141,7 +141,7 @@ private extension HomeView {
var detailViewLink: some View {
NavigationLink(unwrapping: viewStore.$route, case: /HomeReducer.Route.detail) { route in
DetailView(
store: store.scope(state: \.detailState, action: HomeReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand All @@ -152,17 +152,17 @@ private extension HomeView {
switch route.wrappedValue {
case .popular:
PopularView(
store: store.scope(state: \.popularState, action: HomeReducer.Action.popular),
store: store.scope(state: \.popularState, action: \.popular),
user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator
)
case .watched:
WatchedView(
store: store.scope(state: \.watchedState, action: HomeReducer.Action.watched),
store: store.scope(state: \.watchedState, action: \.watched),
user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator
)
case .history:
HistoryView(
store: store.scope(state: \.historyState, action: HomeReducer.Action.history),
store: store.scope(state: \.historyState, action: \.history),
user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator
)
}
Expand All @@ -173,12 +173,12 @@ private extension HomeView {
switch route.wrappedValue {
case .frontpage:
FrontpageView(
store: store.scope(state: \.frontpageState, action: HomeReducer.Action.frontpage),
store: store.scope(state: \.frontpageState, action: \.frontpage),
user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator
)
case .toplists:
ToplistsView(
store: store.scope(state: \.toplistsState, action: HomeReducer.Action.toplists),
store: store.scope(state: \.toplistsState, action: \.toplists),
user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator
)
}
Expand Down
6 changes: 3 additions & 3 deletions EhPanda/View/Home/Popular/PopularView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct PopularView: View {
}
)
.sheet(unwrapping: viewStore.$route, case: /PopularReducer.Route.filters) { _ in
FiltersView(store: store.scope(state: \.filtersState, action: PopularReducer.Action.filters))
FiltersView(store: store.scope(state: \.filtersState, action: \.filters))
.autoBlur(radius: blurRadius).environment(\.inSheet, true)
}
.searchable(text: viewStore.$keyword, prompt: L10n.Localizable.Searchable.Prompt.filter)
Expand All @@ -62,7 +62,7 @@ struct PopularView: View {
.sheet(unwrapping: viewStore.$route, case: /PopularReducer.Route.detail) { route in
NavigationView {
DetailView(
store: store.scope(state: \.detailState, action: PopularReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand All @@ -78,7 +78,7 @@ struct PopularView: View {
if DeviceUtil.isPhone {
NavigationLink(unwrapping: viewStore.$route, case: /PopularReducer.Route.detail) { route in
DetailView(
store: store.scope(state: \.detailState, action: PopularReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand Down
4 changes: 2 additions & 2 deletions EhPanda/View/Home/Toplists/ToplistsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct ToplistsView: View {
.sheet(unwrapping: viewStore.$route, case: /ToplistsReducer.Route.detail) { route in
NavigationView {
DetailView(
store: store.scope(state: \.detailState, action: ToplistsReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand All @@ -89,7 +89,7 @@ struct ToplistsView: View {
if DeviceUtil.isPhone {
NavigationLink(unwrapping: viewStore.$route, case: /ToplistsReducer.Route.detail) { route in
DetailView(
store: store.scope(state: \.detailState, action: ToplistsReducer.Action.detail),
store: store.scope(state: \.detailState, action: \.detail),
gid: route.wrappedValue, user: user, setting: $setting,
blurRadius: blurRadius, tagTranslator: tagTranslator
)
Expand Down
Loading

0 comments on commit 9a02e11

Please sign in to comment.