From 9a02e113c435eea3ecbd2d46f9c98b0b0e256c1e Mon Sep 17 00:00:00 2001 From: Chihchy Date: Thu, 11 Jul 2024 07:46:24 +0800 Subject: [PATCH] Migrate TCA to 1.5 --- EhPanda.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- EhPanda/App/EhPandaApp.swift | 2 +- EhPanda/View/Detail/Comments/CommentsView.swift | 2 +- .../Detail/DetailSearch/DetailSearchView.swift | 8 ++++---- EhPanda/View/Detail/DetailView.swift | 14 +++++++------- EhPanda/View/Detail/Previews/PreviewsView.swift | 2 +- EhPanda/View/Favorites/FavoritesView.swift | 6 +++--- EhPanda/View/Home/Frontpage/FrontpageView.swift | 6 +++--- EhPanda/View/Home/History/HistoryView.swift | 4 ++-- EhPanda/View/Home/HomeView.swift | 14 +++++++------- EhPanda/View/Home/Popular/PopularView.swift | 6 +++--- EhPanda/View/Home/Toplists/ToplistsView.swift | 4 ++-- EhPanda/View/Home/Watched/WatchedView.swift | 8 ++++---- EhPanda/View/Search/SearchRootView.swift | 10 +++++----- EhPanda/View/Search/SearchView.swift | 8 ++++---- .../AccountSetting/AccountSettingView.swift | 4 ++-- .../GeneralSetting/GeneralSettingView.swift | 2 +- EhPanda/View/Setting/SettingView.swift | 6 +++--- EhPanda/View/TabBar/TabBarView.swift | 12 ++++++------ 20 files changed, 62 insertions(+), 62 deletions(-) diff --git a/EhPanda.xcodeproj/project.pbxproj b/EhPanda.xcodeproj/project.pbxproj index aa55d99a..682ab2e3 100644 --- a/EhPanda.xcodeproj/project.pbxproj +++ b/EhPanda.xcodeproj/project.pbxproj @@ -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" */ = { diff --git a/EhPanda.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/EhPanda.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 2380d21a..c8c973cc 100644 --- a/EhPanda.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/EhPanda.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -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" } }, { diff --git a/EhPanda/App/EhPandaApp.swift b/EhPanda/App/EhPandaApp.swift index 208f0d3a..bc19879c 100644 --- a/EhPanda/App/EhPandaApp.swift +++ b/EhPanda/App/EhPandaApp.swift @@ -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) diff --git a/EhPanda/View/Detail/Comments/CommentsView.swift b/EhPanda/View/Detail/Comments/CommentsView.swift index 50cdd5a5..b13ea4d5 100644 --- a/EhPanda/View/Detail/Comments/CommentsView.swift +++ b/EhPanda/View/Detail/Comments/CommentsView.swift @@ -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 ) diff --git a/EhPanda/View/Detail/DetailSearch/DetailSearchView.swift b/EhPanda/View/Detail/DetailSearch/DetailSearchView.swift index 9e6d6833..3850c967 100644 --- a/EhPanda/View/Detail/DetailSearch/DetailSearchView.swift +++ b/EhPanda/View/Detail/DetailSearch/DetailSearchView.swift @@ -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)) @@ -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) @@ -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 ) @@ -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 ) diff --git a/EhPanda/View/Detail/DetailView.swift b/EhPanda/View/Detail/DetailView.swift index ec601b2c..0a0c75e2 100644 --- a/EhPanda/View/Detail/DetailView.swift +++ b/EhPanda/View/Detail/DetailView.swift @@ -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) @@ -132,7 +132,7 @@ 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) @@ -140,7 +140,7 @@ struct DetailView: View { } .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) @@ -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, @@ -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 @@ -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 ) } diff --git a/EhPanda/View/Detail/Previews/PreviewsView.swift b/EhPanda/View/Detail/Previews/PreviewsView.swift index 5fc13cb0..b44cbfe6 100644 --- a/EhPanda/View/Detail/Previews/PreviewsView.swift +++ b/EhPanda/View/Detail/Previews/PreviewsView.swift @@ -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) diff --git a/EhPanda/View/Favorites/FavoritesView.swift b/EhPanda/View/Favorites/FavoritesView.swift index 8d7ffa44..0227a92a 100644 --- a/EhPanda/View/Favorites/FavoritesView.swift +++ b/EhPanda/View/Favorites/FavoritesView.swift @@ -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)) @@ -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 ) @@ -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 ) diff --git a/EhPanda/View/Home/Frontpage/FrontpageView.swift b/EhPanda/View/Home/Frontpage/FrontpageView.swift index 12649539..4f147025 100644 --- a/EhPanda/View/Home/Frontpage/FrontpageView.swift +++ b/EhPanda/View/Home/Frontpage/FrontpageView.swift @@ -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) @@ -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 ) @@ -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 ) diff --git a/EhPanda/View/Home/History/HistoryView.swift b/EhPanda/View/Home/History/HistoryView.swift index 83a06763..25e7e72f 100644 --- a/EhPanda/View/Home/History/HistoryView.swift +++ b/EhPanda/View/Home/History/HistoryView.swift @@ -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 ) @@ -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 ) diff --git a/EhPanda/View/Home/HomeView.swift b/EhPanda/View/Home/HomeView.swift index 7db50c93..deda931a 100644 --- a/EhPanda/View/Home/HomeView.swift +++ b/EhPanda/View/Home/HomeView.swift @@ -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 ) @@ -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 ) @@ -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 ) } @@ -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 ) } diff --git a/EhPanda/View/Home/Popular/PopularView.swift b/EhPanda/View/Home/Popular/PopularView.swift index 9658faf1..67dce9f7 100644 --- a/EhPanda/View/Home/Popular/PopularView.swift +++ b/EhPanda/View/Home/Popular/PopularView.swift @@ -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) @@ -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 ) @@ -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 ) diff --git a/EhPanda/View/Home/Toplists/ToplistsView.swift b/EhPanda/View/Home/Toplists/ToplistsView.swift index f9ecbfd2..a7f6236c 100644 --- a/EhPanda/View/Home/Toplists/ToplistsView.swift +++ b/EhPanda/View/Home/Toplists/ToplistsView.swift @@ -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 ) @@ -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 ) diff --git a/EhPanda/View/Home/Watched/WatchedView.swift b/EhPanda/View/Home/Watched/WatchedView.swift index 2cbd32a6..0f0f21ce 100644 --- a/EhPanda/View/Home/Watched/WatchedView.swift +++ b/EhPanda/View/Home/Watched/WatchedView.swift @@ -51,7 +51,7 @@ struct WatchedView: View { } .sheet(unwrapping: viewStore.$route, case: /WatchedReducer.Route.quickSearch) { _ in QuickSearchView( - store: store.scope(state: \.quickSearchState, action: WatchedReducer.Action.quickSearch) + store: store.scope(state: \.quickSearchState, action: \.quickSearch) ) { keyword in viewStore.send(.setNavigation(nil)) viewStore.send(.fetchGalleries(keyword)) @@ -60,7 +60,7 @@ struct WatchedView: View { .autoBlur(radius: blurRadius) } .sheet(unwrapping: viewStore.$route, case: /WatchedReducer.Route.filters) { _ in - FiltersView(store: store.scope(state: \.filtersState, action: WatchedReducer.Action.filters)) + FiltersView(store: store.scope(state: \.filtersState, action: \.filters)) .autoBlur(radius: blurRadius).environment(\.inSheet, true) } .searchable(text: viewStore.$keyword) @@ -89,7 +89,7 @@ struct WatchedView: View { .sheet(unwrapping: viewStore.$route, case: /WatchedReducer.Route.detail) { route in NavigationView { DetailView( - store: store.scope(state: \.detailState, action: WatchedReducer.Action.detail), + store: store.scope(state: \.detailState, action: \.detail), gid: route.wrappedValue, user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator ) @@ -105,7 +105,7 @@ struct WatchedView: View { if DeviceUtil.isPhone { NavigationLink(unwrapping: viewStore.$route, case: /WatchedReducer.Route.detail) { route in DetailView( - store: store.scope(state: \.detailState, action: WatchedReducer.Action.detail), + store: store.scope(state: \.detailState, action: \.detail), gid: route.wrappedValue, user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator ) diff --git a/EhPanda/View/Search/SearchRootView.swift b/EhPanda/View/Search/SearchRootView.swift index 3fc79528..397a7d1e 100644 --- a/EhPanda/View/Search/SearchRootView.swift +++ b/EhPanda/View/Search/SearchRootView.swift @@ -46,12 +46,12 @@ struct SearchRootView: View { ) } .sheet(unwrapping: viewStore.$route, case: /SearchRootReducer.Route.filters) { _ in - FiltersView(store: store.scope(state: \.filtersState, action: SearchRootReducer.Action.filters)) + FiltersView(store: store.scope(state: \.filtersState, action: \.filters)) .autoBlur(radius: blurRadius).environment(\.inSheet, true) } .sheet(unwrapping: viewStore.$route, case: /SearchRootReducer.Route.quickSearch) { _ in QuickSearchView( - store: store.scope(state: \.quickSearchState, action: SearchRootReducer.Action.quickSearch) + store: store.scope(state: \.quickSearchState, action: \.quickSearch) ) { keyword in viewStore.send(.setNavigation(nil)) viewStore.send(.setKeyword(keyword)) @@ -85,7 +85,7 @@ struct SearchRootView: View { .sheet(unwrapping: viewStore.$route, case: /SearchRootReducer.Route.detail) { route in NavigationView { DetailView( - store: store.scope(state: \.detailState, action: SearchRootReducer.Action.detail), + store: store.scope(state: \.detailState, action: \.detail), gid: route.wrappedValue, user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator ) @@ -122,7 +122,7 @@ private extension SearchRootView { var detailViewLink: some View { NavigationLink(unwrapping: viewStore.$route, case: /SearchRootReducer.Route.detail) { route in DetailView( - store: store.scope(state: \.detailState, action: SearchRootReducer.Action.detail), + store: store.scope(state: \.detailState, action: \.detail), gid: route.wrappedValue, user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator ) @@ -131,7 +131,7 @@ private extension SearchRootView { var searchViewLink: some View { NavigationLink(unwrapping: viewStore.$route, case: /SearchRootReducer.Route.search) { _ in SearchView( - store: store.scope(state: \.searchState, action: SearchRootReducer.Action.search), + store: store.scope(state: \.searchState, action: \.search), keyword: viewStore.keyword, user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator ) diff --git a/EhPanda/View/Search/SearchView.swift b/EhPanda/View/Search/SearchView.swift index 122ecd6f..393ddeae 100644 --- a/EhPanda/View/Search/SearchView.swift +++ b/EhPanda/View/Search/SearchView.swift @@ -47,7 +47,7 @@ struct SearchView: View { ) .sheet(unwrapping: viewStore.$route, case: /SearchReducer.Route.quickSearch) { _ in QuickSearchView( - store: store.scope(state: \.quickSearchState, action: SearchReducer.Action.quickSearch) + store: store.scope(state: \.quickSearchState, action: \.quickSearch) ) { keyword in viewStore.send(.setNavigation(nil)) viewStore.send(.fetchGalleries(keyword)) @@ -56,7 +56,7 @@ struct SearchView: View { .autoBlur(radius: blurRadius) } .sheet(unwrapping: viewStore.$route, case: /SearchReducer.Route.filters) { _ in - FiltersView(store: store.scope(state: \.filtersState, action: SearchReducer.Action.filters)) + FiltersView(store: store.scope(state: \.filtersState, action: \.filters)) .accentColor(setting.accentColor).autoBlur(radius: blurRadius) } .searchable(text: viewStore.$keyword) @@ -85,7 +85,7 @@ struct SearchView: View { .sheet(unwrapping: viewStore.$route, case: /SearchReducer.Route.detail) { route in NavigationView { DetailView( - store: store.scope(state: \.detailState, action: SearchReducer.Action.detail), + store: store.scope(state: \.detailState, action: \.detail), gid: route.wrappedValue, user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator ) @@ -101,7 +101,7 @@ struct SearchView: View { if DeviceUtil.isPhone { NavigationLink(unwrapping: viewStore.$route, case: /SearchReducer.Route.detail) { route in DetailView( - store: store.scope(state: \.detailState, action: SearchReducer.Action.detail), + store: store.scope(state: \.detailState, action: \.detail), gid: route.wrappedValue, user: user, setting: $setting, blurRadius: blurRadius, tagTranslator: tagTranslator ) diff --git a/EhPanda/View/Setting/AccountSetting/AccountSettingView.swift b/EhPanda/View/Setting/AccountSetting/AccountSettingView.swift index de1606a4..5b911b38 100644 --- a/EhPanda/View/Setting/AccountSetting/AccountSettingView.swift +++ b/EhPanda/View/Setting/AccountSetting/AccountSettingView.swift @@ -80,13 +80,13 @@ private extension AccountSettingView { @ViewBuilder var navigationLinks: some View { NavigationLink(unwrapping: viewStore.$route, case: /AccountSettingReducer.Route.login) { _ in LoginView( - store: store.scope(state: \.loginState, action: AccountSettingReducer.Action.login), + store: store.scope(state: \.loginState, action: \.login), bypassesSNIFiltering: bypassesSNIFiltering, blurRadius: blurRadius ) } NavigationLink(unwrapping: viewStore.$route, case: /AccountSettingReducer.Route.ehSetting) { _ in EhSettingView( - store: store.scope(state: \.ehSettingState, action: AccountSettingReducer.Action.ehSetting), + store: store.scope(state: \.ehSettingState, action: \.ehSetting), bypassesSNIFiltering: bypassesSNIFiltering, blurRadius: blurRadius ) } diff --git a/EhPanda/View/Setting/GeneralSetting/GeneralSettingView.swift b/EhPanda/View/Setting/GeneralSetting/GeneralSettingView.swift index 3b5bb09c..2a9ab938 100644 --- a/EhPanda/View/Setting/GeneralSetting/GeneralSettingView.swift +++ b/EhPanda/View/Setting/GeneralSetting/GeneralSettingView.swift @@ -187,7 +187,7 @@ struct GeneralSettingView: View { private var navigationLink: some View { NavigationLink(unwrapping: viewStore.$route, case: /GeneralSettingReducer.Route.logs) { _ in - LogsView(store: store.scope(state: \.logsState, action: GeneralSettingReducer.Action.logs)) + LogsView(store: store.scope(state: \.logsState, action: \.logs)) } } } diff --git a/EhPanda/View/Setting/SettingView.swift b/EhPanda/View/Setting/SettingView.swift index 9a77b565..0f106478 100644 --- a/EhPanda/View/Setting/SettingView.swift +++ b/EhPanda/View/Setting/SettingView.swift @@ -44,7 +44,7 @@ private extension SettingView { @ViewBuilder var navigationLinks: some View { NavigationLink(unwrapping: viewStore.$route, case: /SettingReducer.Route.account) { _ in AccountSettingView( - store: store.scope(state: \.accountSettingState, action: SettingReducer.Action.account), + store: store.scope(state: \.accountSettingState, action: \.account), galleryHost: viewStore.$setting.galleryHost, showsNewDawnGreeting: viewStore.$setting.showsNewDawnGreeting, bypassesSNIFiltering: viewStore.setting.bypassesSNIFiltering, @@ -54,7 +54,7 @@ private extension SettingView { } NavigationLink(unwrapping: viewStore.$route, case: /SettingReducer.Route.general) { _ in GeneralSettingView( - store: store.scope(state: \.generalSettingState, action: SettingReducer.Action.general), + store: store.scope(state: \.generalSettingState, action: \.general), tagTranslatorLoadingState: viewStore.tagTranslatorLoadingState, tagTranslatorEmpty: viewStore.tagTranslator.translations.isEmpty, tagTranslatorHasCustomTranslations: viewStore.tagTranslator.hasCustomTranslations, @@ -71,7 +71,7 @@ private extension SettingView { } NavigationLink(unwrapping: viewStore.$route, case: /SettingReducer.Route.appearance) { _ in AppearanceSettingView( - store: store.scope(state: \.appearanceSettingState, action: SettingReducer.Action.appearance), + store: store.scope(state: \.appearanceSettingState, action: \.appearance), preferredColorScheme: viewStore.$setting.preferredColorScheme, accentColor: viewStore.$setting.accentColor, appIconType: viewStore.$setting.appIconType, diff --git a/EhPanda/View/TabBar/TabBarView.swift b/EhPanda/View/TabBar/TabBarView.swift index 62ee7e9a..515e6d8a 100644 --- a/EhPanda/View/TabBar/TabBarView.swift +++ b/EhPanda/View/TabBar/TabBarView.swift @@ -32,7 +32,7 @@ struct TabBarView: View { switch type { case .home: HomeView( - store: store.scope(state: \.homeState, action: AppReducer.Action.home), + store: store.scope(state: \.homeState, action: \.home), user: viewStore.settingState.user, setting: viewStore.$settingState.setting, blurRadius: viewStore.appLockState.blurRadius, @@ -40,7 +40,7 @@ struct TabBarView: View { ) case .favorites: FavoritesView( - store: store.scope(state: \.favoritesState, action: AppReducer.Action.favorites), + store: store.scope(state: \.favoritesState, action: \.favorites), user: viewStore.settingState.user, setting: viewStore.$settingState.setting, blurRadius: viewStore.appLockState.blurRadius, @@ -48,7 +48,7 @@ struct TabBarView: View { ) case .search: SearchRootView( - store: store.scope(state: \.searchRootState, action: AppReducer.Action.searchRoot), + store: store.scope(state: \.searchRootState, action: \.searchRoot), user: viewStore.settingState.user, setting: viewStore.$settingState.setting, blurRadius: viewStore.appLockState.blurRadius, @@ -56,7 +56,7 @@ struct TabBarView: View { ) case .setting: SettingView( - store: store.scope(state: \.settingState, action: AppReducer.Action.setting), + store: store.scope(state: \.settingState, action: \.setting), blurRadius: viewStore.appLockState.blurRadius ) } @@ -79,7 +79,7 @@ struct TabBarView: View { } .sheet(unwrapping: viewStore.$appRouteState.route, case: /AppRouteReducer.Route.setting) { _ in SettingView( - store: store.scope(state: \.settingState, action: AppReducer.Action.setting), + store: store.scope(state: \.settingState, action: \.setting), blurRadius: viewStore.appLockState.blurRadius ) .accentColor(viewStore.settingState.setting.accentColor) @@ -90,7 +90,7 @@ struct TabBarView: View { DetailView( store: store.scope( state: \.appRouteState.detailState, - action: { AppReducer.Action.appRoute(.detail($0)) } + action: \.appRoute.detail ), gid: route.wrappedValue, user: viewStore.settingState.user, setting: viewStore.$settingState.setting,