diff --git a/.swiftlint.yml b/.swiftlint.yml index 22adb80e..65bd698e 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -15,3 +15,4 @@ identifier_name: excluded: - EhPandaTests + - EhPanda/App/Generated diff --git a/EhPanda/DataFlow/AppRouteReducer.swift b/EhPanda/DataFlow/AppRouteReducer.swift index e8b41369..e657beee 100644 --- a/EhPanda/DataFlow/AppRouteReducer.swift +++ b/EhPanda/DataFlow/AppRouteReducer.swift @@ -147,8 +147,11 @@ struct AppRouteReducer: Reducer { case .fetchGallery(let url, let isGalleryImageURL): state.route = .hud return .run { send in - let response = await GalleryReverseRequest(url: url, isGalleryImageURL: isGalleryImageURL).response() - await send(Action.fetchGalleryDone(url, response)) + let response = await GalleryReverseRequest( + url: url, isGalleryImageURL: isGalleryImageURL + ) + .response() + await send(.fetchGalleryDone(url, response)) } case .fetchGalleryDone(let url, let result): @@ -164,7 +167,7 @@ struct AppRouteReducer: Reducer { case .failure: return .run { send in try await Task.sleep(for: .milliseconds(500)) - await send(Action.setHUDConfig(.error)) + await send(.setHUDConfig(.error)) } } diff --git a/EhPanda/Models/Tags/TagDetail.swift b/EhPanda/Models/Tags/TagDetail.swift index 3300a0ee..fb7a13c9 100644 --- a/EhPanda/Models/Tags/TagDetail.swift +++ b/EhPanda/Models/Tags/TagDetail.swift @@ -12,11 +12,4 @@ struct TagDetail: Equatable { let description: String let imageURLs: [URL] let links: [URL] - - init(title: String, description: String, imageURLs: [URL], links: [URL]) { - self.title = title - self.description = description - self.imageURLs = imageURLs - self.links = links - } } diff --git a/EhPanda/View/Detail/Archives/ArchivesReducer.swift b/EhPanda/View/Detail/Archives/ArchivesReducer.swift index 6c7a7510..cd843ec1 100644 --- a/EhPanda/View/Detail/Archives/ArchivesReducer.swift +++ b/EhPanda/View/Detail/Archives/ArchivesReducer.swift @@ -74,7 +74,7 @@ struct ArchivesReducer: Reducer { state.loadingState = .loading return .run { send in let response = await GalleryArchiveRequest(archiveURL: archiveURL).response() - await send(Action.fetchArchiveDone(gid, galleryURL, response)) + await send(.fetchArchiveDone(gid, galleryURL, response)) } .cancellable(id: CancelID.fetchArchive) @@ -103,7 +103,7 @@ struct ArchivesReducer: Reducer { guard let galleryURL = galleryURL.replaceHost(to: Defaults.URL.ehentai.host) else { return .none } return .run { send in let response = await GalleryArchiveFundsRequest(gid: gid, galleryURL: galleryURL).response() - await send(Action.fetchArchiveFundsDone(response)) + await send(.fetchArchiveFundsDone(response)) } .cancellable(id: CancelID.fetchArchiveFunds) @@ -122,8 +122,9 @@ struct ArchivesReducer: Reducer { let response = await SendDownloadCommandRequest( archiveURL: archiveURL, resolution: selectedArchive.resolution.parameter - ).response() - await send(Action.fetchDownloadResponseDone(response)) + ) + .response() + await send(.fetchDownloadResponseDone(response)) } .cancellable(id: CancelID.fetchDownloadResponse) diff --git a/EhPanda/View/Detail/Comments/CommentsReducer.swift b/EhPanda/View/Detail/Comments/CommentsReducer.swift index 963b6935..85a1c815 100644 --- a/EhPanda/View/Detail/Comments/CommentsReducer.swift +++ b/EhPanda/View/Detail/Comments/CommentsReducer.swift @@ -193,14 +193,18 @@ struct CommentsReducer: Reducer { commentID: commentID, content: commentContent, galleryURL: galleryURL - ).response() - await send(Action.performCommentActionDone(response)) + ) + .response() + await send(.performCommentActionDone(response)) } .cancellable(id: CancelID.postComment) } else { return .run { [commentContent = state.commentContent] send in - let response = await CommentGalleryRequest(content: commentContent, galleryURL: galleryURL).response() - await send(Action.performCommentActionDone(response)) + let response = await CommentGalleryRequest( + content: commentContent, galleryURL: galleryURL + ) + .response() + await send(.performCommentActionDone(response)) } .cancellable(id: CancelID.postComment) } @@ -217,8 +221,9 @@ struct CommentsReducer: Reducer { token: token, commentID: commentID, commentVote: vote - ).response() - await send(Action.performCommentActionDone(response)) + ) + .response() + await send(.performCommentActionDone(response)) } .cancellable(id: CancelID.voteComment) @@ -228,8 +233,11 @@ struct CommentsReducer: Reducer { case .fetchGallery(let url, let isGalleryImageURL): state.route = .hud return .run { send in - let response = await GalleryReverseRequest(url: url, isGalleryImageURL: isGalleryImageURL).response() - await send(Action.fetchGalleryDone(url, response)) + let response = await GalleryReverseRequest( + url: url, isGalleryImageURL: isGalleryImageURL + ) + .response() + await send(.fetchGalleryDone(url, response)) } .cancellable(id: CancelID.fetchGallery) diff --git a/EhPanda/View/Detail/DetailReducer.swift b/EhPanda/View/Detail/DetailReducer.swift index cf699d6c..233a22d0 100644 --- a/EhPanda/View/Detail/DetailReducer.swift +++ b/EhPanda/View/Detail/DetailReducer.swift @@ -280,7 +280,7 @@ struct DetailReducer: Reducer { state.loadingState = .loading return .run { [galleryID = state.gallery.id] send in let response = await GalleryDetailRequest(gid: galleryID, galleryURL: galleryURL).response() - await send(Action.fetchGalleryDetailDone(response)) + await send(.fetchGalleryDetailDone(response)) } .cancellable(id: CancelID.fetchGalleryDetail) @@ -325,8 +325,9 @@ struct DetailReducer: Reducer { gid: gid, token: state.gallery.token, rating: state.userRating - ).response() - await send(Action.anyGalleryOpsDone(response)) + ) + .response() + await send(.anyGalleryOpsDone(response)) }.cancellable(id: CancelID.rateGallery) case .favorGallery(let favIndex): @@ -335,23 +336,27 @@ struct DetailReducer: Reducer { gid: state.gallery.id, token: state.gallery.token, favIndex: favIndex - ).response() - await send(Action.anyGalleryOpsDone(response)) + ) + .response() + await send(.anyGalleryOpsDone(response)) } .cancellable(id: CancelID.favorGallery) case .unfavorGallery: return .run { [galleryID = state.gallery.id] send in let response = await UnfavorGalleryRequest(gid: galleryID).response() - await send(Action.anyGalleryOpsDone(response)) + await send(.anyGalleryOpsDone(response)) } .cancellable(id: CancelID.unfavorGallery) case .postComment(let galleryURL): guard !state.commentContent.isEmpty else { return .none } return .run { [commentContent = state.commentContent] send in - let response = await CommentGalleryRequest(content: commentContent, galleryURL: galleryURL).response() - await send(Action.anyGalleryOpsDone(response)) + let response = await CommentGalleryRequest( + content: commentContent, galleryURL: galleryURL + ) + .response() + await send(.anyGalleryOpsDone(response)) } .cancellable(id: CancelID.postComment) @@ -366,8 +371,9 @@ struct DetailReducer: Reducer { token: state.gallery.token, tag: tag, vote: vote - ).response() - await send(Action.anyGalleryOpsDone(response)) + ) + .response() + await send(.anyGalleryOpsDone(response)) } .cancellable(id: CancelID.voteTag) diff --git a/EhPanda/View/Detail/DetailSearch/DetailSearchReducer.swift b/EhPanda/View/Detail/DetailSearch/DetailSearchReducer.swift index 0552db23..08d4a819 100644 --- a/EhPanda/View/Detail/DetailSearch/DetailSearchReducer.swift +++ b/EhPanda/View/Detail/DetailSearch/DetailSearchReducer.swift @@ -108,7 +108,7 @@ struct DetailSearchReducer: Reducer { let filter = databaseClient.fetchFilterSynchronously(range: .search) return .run { [lastKeyword = state.lastKeyword] send in let response = await SearchGalleriesRequest(keyword: lastKeyword, filter: filter).response() - await send(Action.fetchGalleriesDone(response)) + await send(.fetchGalleriesDone(response)) } .cancellable(id: CancelID.fetchGalleries) @@ -140,8 +140,11 @@ struct DetailSearchReducer: Reducer { state.footerLoadingState = .loading let filter = databaseClient.fetchFilterSynchronously(range: .search) return .run { [lastKeyword = state.lastKeyword] send in - let response = await MoreSearchGalleriesRequest(keyword: lastKeyword, filter: filter, lastID: lastID).response() - await send(Action.fetchMoreGalleriesDone(response)) + let response = await MoreSearchGalleriesRequest( + keyword: lastKeyword, filter: filter, lastID: lastID + ) + .response() + await send(.fetchMoreGalleriesDone(response)) } .cancellable(id: CancelID.fetchMoreGalleries) diff --git a/EhPanda/View/Detail/Previews/PreviewsReducer.swift b/EhPanda/View/Detail/Previews/PreviewsReducer.swift index ca3bcb01..a25881c6 100644 --- a/EhPanda/View/Detail/Previews/PreviewsReducer.swift +++ b/EhPanda/View/Detail/Previews/PreviewsReducer.swift @@ -113,7 +113,7 @@ struct PreviewsReducer: Reducer { let pageNum = state.previewConfig.pageNumber(index: index) return .run { send in let response = await GalleryPreviewURLsRequest(galleryURL: galleryURL, pageNum: pageNum).response() - await send(Action.fetchPreviewURLsDone(response)) + await send(.fetchPreviewURLsDone(response)) } .cancellable(id: CancelID.fetchPreviewURLs) diff --git a/EhPanda/View/Detail/Torrents/TorrentsReducer.swift b/EhPanda/View/Detail/Torrents/TorrentsReducer.swift index 36f47431..cf10db19 100644 --- a/EhPanda/View/Detail/Torrents/TorrentsReducer.swift +++ b/EhPanda/View/Detail/Torrents/TorrentsReducer.swift @@ -76,7 +76,7 @@ struct TorrentsReducer: Reducer { case .fetchTorrent(let hash, let torrentURL): return .run { send in let response = await DataRequest(url: torrentURL).response() - await send(Action.fetchTorrentDone(hash, response)) + await send(.fetchTorrentDone(hash, response)) } .cancellable(id: CancelID.fetchTorrent) @@ -94,7 +94,7 @@ struct TorrentsReducer: Reducer { state.loadingState = .loading return .run { send in let response = await GalleryTorrentsRequest(gid: gid, token: token).response() - await send(Action.fetchGalleryTorrentsDone(response)) + await send(.fetchGalleryTorrentsDone(response)) } .cancellable(id: CancelID.fetchGalleryTorrents) diff --git a/EhPanda/View/Favorites/FavoritesReducer.swift b/EhPanda/View/Favorites/FavoritesReducer.swift index e2829885..b0b5676b 100644 --- a/EhPanda/View/Favorites/FavoritesReducer.swift +++ b/EhPanda/View/Favorites/FavoritesReducer.swift @@ -93,7 +93,7 @@ struct FavoritesReducer: Reducer { case .setFavoritesIndex(let index): state.index = index guard state.galleries?.isEmpty != false else { return .none } - return .send(Action.fetchGalleries()) + return .send(.fetchGalleries()) case .clearSubStates: state.detailState = .init() @@ -116,8 +116,9 @@ struct FavoritesReducer: Reducer { return .run { [state] send in let response = await FavoritesGalleriesRequest( favIndex: state.index, keyword: state.keyword, sortOrder: sortOrder - ).response() - await send(Action.fetchGalleriesDone(state.index, response)) + ) + .response() + await send(.fetchGalleriesDone(state.index, response)) } case .fetchGalleriesDone(let targetFavIndex, let result): @@ -154,8 +155,9 @@ struct FavoritesReducer: Reducer { lastID: lastID, lastTimestamp: lastItemTimestamp, keyword: state.keyword - ).response() - await send(Action.fetchMoreGalleriesDone(state.index, response)) + ) + .response() + await send(.fetchMoreGalleriesDone(state.index, response)) } case .fetchMoreGalleriesDone(let targetFavIndex, let result): diff --git a/EhPanda/View/Home/Frontpage/FrontpageReducer.swift b/EhPanda/View/Home/Frontpage/FrontpageReducer.swift index c8c7c983..65e1367a 100644 --- a/EhPanda/View/Home/Frontpage/FrontpageReducer.swift +++ b/EhPanda/View/Home/Frontpage/FrontpageReducer.swift @@ -94,7 +94,7 @@ struct FrontpageReducer: Reducer { let filter = databaseClient.fetchFilterSynchronously(range: .global) return .run { send in let response = await FrontpageGalleriesRequest(filter: filter).response() - await send(Action.fetchGalleriesDone(response)) + await send(.fetchGalleriesDone(response)) } .cancellable(id: CancelID.fetchGalleries) @@ -127,7 +127,7 @@ struct FrontpageReducer: Reducer { let filter = databaseClient.fetchFilterSynchronously(range: .global) return .run { send in let response = await MoreFrontpageGalleriesRequest(filter: filter, lastID: lastID).response() - await send(Action.fetchMoreGalleriesDone(response)) + await send(.fetchMoreGalleriesDone(response)) } .cancellable(id: CancelID.fetchMoreGalleries) diff --git a/EhPanda/View/Home/HomeReducer.swift b/EhPanda/View/Home/HomeReducer.swift index 3b6ccc68..318af824 100644 --- a/EhPanda/View/Home/HomeReducer.swift +++ b/EhPanda/View/Home/HomeReducer.swift @@ -157,7 +157,7 @@ struct HomeReducer: Reducer { let filter = databaseClient.fetchFilterSynchronously(range: .global) return .run { send in let response = await PopularGalleriesRequest(filter: filter).response() - await send(Action.fetchPopularGalleriesDone(response)) + await send(.fetchPopularGalleriesDone(response)) } case .fetchPopularGalleriesDone(let result): @@ -183,7 +183,7 @@ struct HomeReducer: Reducer { let filter = databaseClient.fetchFilterSynchronously(range: .global) return .run { send in let response = await FrontpageGalleriesRequest(filter: filter).response() - await send(Action.fetchFrontpageGalleriesDone(response)) + await send(.fetchFrontpageGalleriesDone(response)) } case .fetchFrontpageGalleriesDone(let result): @@ -208,7 +208,7 @@ struct HomeReducer: Reducer { state.toplistsLoadingState[index] = .loading return .run { send in let response = await ToplistsGalleriesRequest(catIndex: index, pageNum: pageNum).response() - await send(Action.fetchToplistsGalleriesDone(index, response)) + await send(.fetchToplistsGalleriesDone(index, response)) } case .fetchToplistsGalleriesDone(let index, let result): diff --git a/EhPanda/View/Home/Popular/PopularReducer.swift b/EhPanda/View/Home/Popular/PopularReducer.swift index b5beedd5..405d9690 100644 --- a/EhPanda/View/Home/Popular/PopularReducer.swift +++ b/EhPanda/View/Home/Popular/PopularReducer.swift @@ -81,7 +81,7 @@ struct PopularReducer: Reducer { let filter = databaseClient.fetchFilterSynchronously(range: .global) return .run { send in let response = await PopularGalleriesRequest(filter: filter).response() - await send(Action.fetchGalleriesDone(response)) + await send(.fetchGalleriesDone(response)) } .cancellable(id: CancelID.fetchGalleries) diff --git a/EhPanda/View/Home/Toplists/ToplistsReducer.swift b/EhPanda/View/Home/Toplists/ToplistsReducer.swift index 7cca9ac7..aa22b506 100644 --- a/EhPanda/View/Home/Toplists/ToplistsReducer.swift +++ b/EhPanda/View/Home/Toplists/ToplistsReducer.swift @@ -109,7 +109,7 @@ struct ToplistsReducer: Reducer { case .setToplistsType(let type): state.type = type guard state.galleries?.isEmpty != false else { return .none } - return .send(Action.fetchGalleries()) + return .send(.fetchGalleries()) case .clearSubStates: state.detailState = .init() @@ -147,8 +147,11 @@ struct ToplistsReducer: Reducer { state.rawPageNumber[state.type]?.resetPages() } return .run { [type = state.type] send in - let response = await ToplistsGalleriesRequest(catIndex: type.categoryIndex, pageNum: pageNum).response() - await send(Action.fetchGalleriesDone(type, response)) + let response = await ToplistsGalleriesRequest( + catIndex: type.categoryIndex, pageNum: pageNum + ) + .response() + await send(.fetchGalleriesDone(type, response)) } .cancellable(id: CancelID.fetchGalleries) @@ -179,8 +182,11 @@ struct ToplistsReducer: Reducer { state.rawFooterLoadingState[state.type] = .loading let pageNum = pageNumber.current + 1 return .run { [type = state.type] send in - let response = await MoreToplistsGalleriesRequest(catIndex: type.categoryIndex, pageNum: pageNum).response() - await send(Action.fetchMoreGalleriesDone(type, response)) + let response = await MoreToplistsGalleriesRequest( + catIndex: type.categoryIndex, pageNum: pageNum + ) + .response() + await send(.fetchMoreGalleriesDone(type, response)) } .cancellable(id: CancelID.fetchMoreGalleries) diff --git a/EhPanda/View/Home/Watched/WatchedReducer.swift b/EhPanda/View/Home/Watched/WatchedReducer.swift index 35407d48..d14f6939 100644 --- a/EhPanda/View/Home/Watched/WatchedReducer.swift +++ b/EhPanda/View/Home/Watched/WatchedReducer.swift @@ -104,7 +104,7 @@ struct WatchedReducer: Reducer { let filter = databaseClient.fetchFilterSynchronously(range: .watched) return .run { [keyword = state.keyword] send in let response = await WatchedGalleriesRequest(filter: filter, keyword: keyword).response() - await send(Action.fetchGalleriesDone(response)) + await send(.fetchGalleriesDone(response)) } .cancellable(id: CancelID.fetchGalleries) @@ -136,8 +136,11 @@ struct WatchedReducer: Reducer { state.footerLoadingState = .loading let filter = databaseClient.fetchFilterSynchronously(range: .watched) return .run { [keyword = state.keyword] send in - let response = await MoreWatchedGalleriesRequest(filter: filter, lastID: lastID, keyword: keyword).response() - await send(Action.fetchMoreGalleriesDone(response)) + let response = await MoreWatchedGalleriesRequest( + filter: filter, lastID: lastID, keyword: keyword + ) + .response() + await send(.fetchMoreGalleriesDone(response)) } .cancellable(id: CancelID.fetchMoreGalleries) diff --git a/EhPanda/View/Reading/ReadingReducer.swift b/EhPanda/View/Reading/ReadingReducer.swift index 7dbe483f..98de95f4 100644 --- a/EhPanda/View/Reading/ReadingReducer.swift +++ b/EhPanda/View/Reading/ReadingReducer.swift @@ -385,7 +385,7 @@ struct ReadingReducer: Reducer { let pageNum = state.previewConfig.pageNumber(index: index) return .run { send in let response = await GalleryPreviewURLsRequest(galleryURL: galleryURL, pageNum: pageNum).response() - await send(Action.fetchPreviewURLsDone(index, response)) + await send(.fetchPreviewURLsDone(index, response)) } .cancellable(id: CancelID.fetchPreviewURLs) @@ -468,7 +468,7 @@ struct ReadingReducer: Reducer { let pageNum = state.previewConfig.pageNumber(index: index) return .run { send in let response = await ThumbnailURLsRequest(galleryURL: galleryURL, pageNum: pageNum).response() - await send(Action.fetchThumbnailURLsDone(index, response)) + await send(.fetchThumbnailURLsDone(index, response)) } .cancellable(id: CancelID.fetchThumbnailURLs) @@ -501,7 +501,7 @@ struct ReadingReducer: Reducer { case .fetchNormalImageURLs(let index, let thumbnailURLs): return .run { send in let response = await GalleryNormalImageURLsRequest(thumbnailURLs: thumbnailURLs).response() - await send(Action.fetchNormalImageURLsDone(index, response)) + await send(.fetchNormalImageURLsDone(index, response)) } .cancellable(id: CancelID.fetchNormalImageURLs) @@ -541,8 +541,9 @@ struct ReadingReducer: Reducer { galleryURL: galleryURL, thumbnailURL: thumbnailURL, storedImageURL: imageURL - ).response() - await send(Action.refetchNormalImageURLsDone(index, response)) + ) + .response() + await send(.refetchNormalImageURLsDone(index, response)) } .cancellable(id: CancelID.refetchNormalImageURLs) @@ -571,7 +572,7 @@ struct ReadingReducer: Reducer { case .fetchMPVKeys(let index, let mpvURL): return .run { send in let response = await MPVKeysRequest(mpvURL: mpvURL).response() - await send(Action.fetchMPVKeysDone(index, response)) + await send(.fetchMPVKeysDone(index, response)) } .cancellable(id: CancelID.fetchMPVKeys) @@ -617,8 +618,9 @@ struct ReadingReducer: Reducer { mpvKey: mpvKey, mpvImageKey: mpvImageKey, skipServerIdentifier: skipServerIdentifier - ).response() - await send(Action.fetchMPVImageURLDone(index, response)) + ) + .response() + await send(.fetchMPVImageURLDone(index, response)) } .cancellable(id: CancelID.fetchMPVImageURL) diff --git a/EhPanda/View/Search/SearchReducer.swift b/EhPanda/View/Search/SearchReducer.swift index b35d981c..9c0ff6fb 100644 --- a/EhPanda/View/Search/SearchReducer.swift +++ b/EhPanda/View/Search/SearchReducer.swift @@ -108,7 +108,7 @@ struct SearchReducer: Reducer { let filter = databaseClient.fetchFilterSynchronously(range: .search) return .run { [lastKeyword = state.lastKeyword] send in let response = await SearchGalleriesRequest(keyword: lastKeyword, filter: filter).response() - await send(Action.fetchGalleriesDone(response)) + await send(.fetchGalleriesDone(response)) } .cancellable(id: CancelID.fetchGalleries) @@ -140,8 +140,11 @@ struct SearchReducer: Reducer { state.footerLoadingState = .loading let filter = databaseClient.fetchFilterSynchronously(range: .search) return .run { [lastKeyword = state.lastKeyword] send in - let response = await MoreSearchGalleriesRequest(keyword: lastKeyword, filter: filter, lastID: lastID).response() - await send(Action.fetchMoreGalleriesDone(response)) + let response = await MoreSearchGalleriesRequest( + keyword: lastKeyword, filter: filter, lastID: lastID + ) + .response() + await send(.fetchMoreGalleriesDone(response)) } .cancellable(id: CancelID.fetchMoreGalleries) diff --git a/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift b/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift index 08db041a..b2af2f6b 100644 --- a/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift +++ b/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift @@ -86,7 +86,7 @@ struct EhSettingReducer: Reducer { state.loadingState = .loading return .run { send in let response = await EhSettingRequest().response() - await send(Action.fetchEhSettingDone(response)) + await send(.fetchEhSettingDone(response)) } .cancellable(id: CancelID.fetchEhSetting) @@ -109,7 +109,7 @@ struct EhSettingReducer: Reducer { state.submittingState = .loading return .run { send in let response = await SubmitEhSettingChangesRequest(ehSetting: ehSetting).response() - await send(Action.submitChangesDone(response)) + await send(.submitChangesDone(response)) } .cancellable(id: CancelID.submitChanges) @@ -129,7 +129,7 @@ struct EhSettingReducer: Reducer { state.submittingState = .loading return .run { send in let response = await EhProfileRequest(action: action, name: name, set: set).response() - await send(Action.performActionDone(response)) + await send(.performActionDone(response)) } .cancellable(id: CancelID.performAction) diff --git a/EhPanda/View/Setting/Login/LoginReducer.swift b/EhPanda/View/Setting/Login/LoginReducer.swift index e94420f7..b66dd23b 100644 --- a/EhPanda/View/Setting/Login/LoginReducer.swift +++ b/EhPanda/View/Setting/Login/LoginReducer.swift @@ -75,7 +75,7 @@ struct LoginReducer: Reducer { }, .run { [state] send in let response = await LoginRequest(username: state.username, password: state.password).response() - await send(Action.loginDone(response)) + await send(.loginDone(response)) } .cancellable(id: CancelID.login) ) diff --git a/EhPanda/View/Setting/SettingReducer.swift b/EhPanda/View/Setting/SettingReducer.swift index bb8dfb2f..969f0968 100644 --- a/EhPanda/View/Setting/SettingReducer.swift +++ b/EhPanda/View/Setting/SettingReducer.swift @@ -314,7 +314,7 @@ struct SettingReducer: Reducer { guard cookieClient.didLogin else { return .none } return .run { send in let response = await IgneousRequest().response() - await send(Action.fetchIgneousDone(response)) + await send(.fetchIgneousDone(response)) } case .fetchIgneousDone(let result): @@ -334,7 +334,7 @@ struct SettingReducer: Reducer { if !uid.isEmpty { return .run { send in let response = await UserInfoRequest(uid: uid).response() - await send(Action.fetchUserInfoDone(response)) + await send(.fetchUserInfoDone(response)) } } return .none @@ -433,7 +433,7 @@ struct SettingReducer: Reducer { guard cookieClient.didLogin else { return .none } return .run { send in let response = await VerifyEhProfileRequest().response() - await send(Action.fetchEhProfileIndexDone(response)) + await send(.fetchEhProfileIndexDone(response)) } case .fetchEhProfileIndexDone(let result): @@ -468,7 +468,7 @@ struct SettingReducer: Reducer { guard cookieClient.didLogin else { return .none } return .run { send in let response = await FavoriteCategoriesRequest().response() - await send(Action.fetchFavoriteCategoriesDone(response)) + await send(.fetchFavoriteCategoriesDone(response)) } case .fetchFavoriteCategoriesDone(let result):