Skip to content

Commit

Permalink
Merge pull request #221 from tatsuz0u/develop
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
tatsuz0u authored Feb 11, 2022
2 parents dd51e38 + e766c97 commit 3bed4e5
Show file tree
Hide file tree
Showing 28 changed files with 507 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [closed]
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
APP_VERSION: '2.1.2'
APP_VERSION: '2.1.3'
SCHEME_NAME: 'EhPanda'
ALTSTORE_JSON_PATH: './AltStore.json'
BUILDS_PATH: '/tmp/action-builds'
Expand Down
102 changes: 95 additions & 7 deletions EhPanda.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
AB3072D2276D734800EFF242 /* SubSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB3072D1276D734800EFF242 /* SubSection.swift */; };
AB3072D4276E19AA00EFF242 /* FrontpageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB3072D3276E19AA00EFF242 /* FrontpageView.swift */; };
AB30E34826D277F7007420BC /* Toplists.html in Resources */ = {isa = PBXBuildFile; fileRef = AB30E34726D277F7007420BC /* Toplists.html */; };
AB31CD3027B666E200F40E0A /* TestError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB31CD2F27B666E200F40E0A /* TestError.swift */; };
AB31CD3227B6671400F40E0A /* BanIntervalParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB31CD3127B6671400F40E0A /* BanIntervalParserTests.swift */; };
AB31CD3727B6695800F40E0A /* HTMLFilename.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB31CD3627B6695800F40E0A /* HTMLFilename.swift */; };
AB31CD3B27B66E0300F40E0A /* ListParserTestType.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB31CD3A27B66E0300F40E0A /* ListParserTestType.swift */; };
AB31CD3D27B66F7D00F40E0A /* GalleryImageURLParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB31CD3C27B66F7D00F40E0A /* GalleryImageURLParserTests.swift */; };
AB31CD3F27B670FD00F40E0A /* GalleryNormalImageURL.html in Resources */ = {isa = PBXBuildFile; fileRef = AB31CD3E27B670FD00F40E0A /* GalleryNormalImageURL.html */; };
AB31CD4127B6769F00F40E0A /* GalleryMPVKeys.html in Resources */ = {isa = PBXBuildFile; fileRef = AB31CD4027B6769F00F40E0A /* GalleryMPVKeys.html */; };
AB31CD4327B676C300F40E0A /* GalleryMPVKeysParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB31CD4227B676C300F40E0A /* GalleryMPVKeysParserTests.swift */; };
AB358311269D7B63009466A5 /* DFURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB358310269D7B63009466A5 /* DFURLProtocol.swift */; };
AB358313269D7E89009466A5 /* DFRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB358312269D7E89009466A5 /* DFRequest.swift */; };
AB358315269D821D009466A5 /* DFExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB358314269D821D009466A5 /* DFExtensions.swift */; };
Expand All @@ -53,7 +61,6 @@
AB3E9E7026D210B1008FE518 /* Watched.html in Resources */ = {isa = PBXBuildFile; fileRef = AB3E9E6826D210B1008FE518 /* Watched.html */; };
AB3E9E7126D210B1008FE518 /* FrontPage.html in Resources */ = {isa = PBXBuildFile; fileRef = AB3E9E6926D210B1008FE518 /* FrontPage.html */; };
AB3E9E7226D210B1008FE518 /* Popular.html in Resources */ = {isa = PBXBuildFile; fileRef = AB3E9E6A26D210B1008FE518 /* Popular.html */; };
AB3E9E7326D210B1008FE518 /* ParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB3E9E6B26D210B1008FE518 /* ParserTests.swift */; };
AB3E9E7426D210B1008FE518 /* TestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB3E9E6D26D210B1008FE518 /* TestHelper.swift */; };
AB4FD2C1268AB83300A95968 /* GalleryDetailMO+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB4FD2C0268AB83300A95968 /* GalleryDetailMO+CoreDataProperties.swift */; };
AB58A5AC2776B2BC00C0D285 /* AppDelegateStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB58A5AB2776B2BC00C0D285 /* AppDelegateStore.swift */; };
Expand Down Expand Up @@ -186,6 +193,9 @@
ABD7005926B1C31500DC59C9 /* Kanna in Frameworks */ = {isa = PBXBuildFile; productRef = ABD7005826B1C31500DC59C9 /* Kanna */; };
ABD970B427A2A39E001693B0 /* R.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABD970B327A2A39E001693B0 /* R.generated.swift */; };
ABD970B727A2A6BD001693B0 /* Rswift in Frameworks */ = {isa = PBXBuildFile; productRef = ABD970B627A2A6BD001693B0 /* Rswift */; };
ABD9770E27B65A7300983DE7 /* ListParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABD9770D27B65A7300983DE7 /* ListParserTests.swift */; };
ABD9771027B65E3400983DE7 /* GalleryDetailParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABD9770F27B65E3400983DE7 /* GalleryDetailParserTests.swift */; };
ABD9771327B6612400983DE7 /* GreetingParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABD9771227B6612400983DE7 /* GreetingParserTests.swift */; };
ABE1867826A1733000689FDC /* LaboratorySettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE1867726A1733000689FDC /* LaboratorySettingView.swift */; };
ABE9401526FF158D0085E158 /* QuickSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE9401426FF158D0085E158 /* QuickSearchView.swift */; };
ABE9402D26FF89220085E158 /* AlertKit in Frameworks */ = {isa = PBXBuildFile; productRef = ABE9402C26FF89220085E158 /* AlertKit */; };
Expand Down Expand Up @@ -277,6 +287,14 @@
AB3072D1276D734800EFF242 /* SubSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubSection.swift; sourceTree = "<group>"; };
AB3072D3276E19AA00EFF242 /* FrontpageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontpageView.swift; sourceTree = "<group>"; };
AB30E34726D277F7007420BC /* Toplists.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Toplists.html; sourceTree = "<group>"; };
AB31CD2F27B666E200F40E0A /* TestError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestError.swift; sourceTree = "<group>"; };
AB31CD3127B6671400F40E0A /* BanIntervalParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BanIntervalParserTests.swift; sourceTree = "<group>"; };
AB31CD3627B6695800F40E0A /* HTMLFilename.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTMLFilename.swift; sourceTree = "<group>"; };
AB31CD3A27B66E0300F40E0A /* ListParserTestType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListParserTestType.swift; sourceTree = "<group>"; };
AB31CD3C27B66F7D00F40E0A /* GalleryImageURLParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryImageURLParserTests.swift; sourceTree = "<group>"; };
AB31CD3E27B670FD00F40E0A /* GalleryNormalImageURL.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = GalleryNormalImageURL.html; sourceTree = "<group>"; };
AB31CD4027B6769F00F40E0A /* GalleryMPVKeys.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = GalleryMPVKeys.html; sourceTree = "<group>"; };
AB31CD4227B676C300F40E0A /* GalleryMPVKeysParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryMPVKeysParserTests.swift; sourceTree = "<group>"; };
AB358310269D7B63009466A5 /* DFURLProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFURLProtocol.swift; sourceTree = "<group>"; };
AB358312269D7E89009466A5 /* DFRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFRequest.swift; sourceTree = "<group>"; };
AB358314269D821D009466A5 /* DFExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFExtensions.swift; sourceTree = "<group>"; };
Expand All @@ -288,7 +306,6 @@
AB3E9E6826D210B1008FE518 /* Watched.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Watched.html; sourceTree = "<group>"; };
AB3E9E6926D210B1008FE518 /* FrontPage.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FrontPage.html; sourceTree = "<group>"; };
AB3E9E6A26D210B1008FE518 /* Popular.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Popular.html; sourceTree = "<group>"; };
AB3E9E6B26D210B1008FE518 /* ParserTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParserTests.swift; sourceTree = "<group>"; };
AB3E9E6D26D210B1008FE518 /* TestHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestHelper.swift; sourceTree = "<group>"; };
AB48BCF626D2539B0021A06C /* Model 2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 2.xcdatamodel"; sourceTree = "<group>"; };
AB4FD2C0268AB83300A95968 /* GalleryDetailMO+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "GalleryDetailMO+CoreDataProperties.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -424,6 +441,9 @@
ABD49D69277EEF73003D1A07 /* SettingStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingStore.swift; sourceTree = "<group>"; };
ABD5FDD3263D05110021A4C6 /* .swiftlint.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = SOURCE_ROOT; };
ABD970B327A2A39E001693B0 /* R.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = R.generated.swift; path = App/R.generated.swift; sourceTree = "<group>"; };
ABD9770D27B65A7300983DE7 /* ListParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListParserTests.swift; sourceTree = "<group>"; };
ABD9770F27B65E3400983DE7 /* GalleryDetailParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryDetailParserTests.swift; sourceTree = "<group>"; };
ABD9771227B6612400983DE7 /* GreetingParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GreetingParserTests.swift; sourceTree = "<group>"; };
ABE1867726A1733000689FDC /* LaboratorySettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaboratorySettingView.swift; sourceTree = "<group>"; };
ABE9376C265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
ABE9376D265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -608,11 +628,49 @@
path = Cells;
sourceTree = "<group>";
};
AB31CD2E27B666D500F40E0A /* Models */ = {
isa = PBXGroup;
children = (
AB31CD2F27B666E200F40E0A /* TestError.swift */,
AB31CD3627B6695800F40E0A /* HTMLFilename.swift */,
AB31CD3A27B66E0300F40E0A /* ListParserTestType.swift */,
);
path = Models;
sourceTree = "<group>";
};
AB31CD3327B6674B00F40E0A /* List */ = {
isa = PBXGroup;
children = (
ABD9770D27B65A7300983DE7 /* ListParserTests.swift */,
);
path = List;
sourceTree = "<group>";
};
AB31CD3427B6675100F40E0A /* Gallery */ = {
isa = PBXGroup;
children = (
ABD9770F27B65E3400983DE7 /* GalleryDetailParserTests.swift */,
AB31CD4227B676C300F40E0A /* GalleryMPVKeysParserTests.swift */,
AB31CD3C27B66F7D00F40E0A /* GalleryImageURLParserTests.swift */,
);
path = Gallery;
sourceTree = "<group>";
};
AB31CD3527B6675D00F40E0A /* Other */ = {
isa = PBXGroup;
children = (
ABD9771227B6612400983DE7 /* GreetingParserTests.swift */,
AB31CD3127B6671400F40E0A /* BanIntervalParserTests.swift */,
);
path = Other;
sourceTree = "<group>";
};
AB3E9E6126D210B1008FE518 /* EhPandaTests */ = {
isa = PBXGroup;
children = (
AB31CD2E27B666D500F40E0A /* Models */,
AB3E9E6226D210B1008FE518 /* Resources */,
AB3E9E6B26D210B1008FE518 /* ParserTests.swift */,
ABD9770C27B65A5300983DE7 /* Parser */,
);
path = EhPandaTests;
sourceTree = "<group>";
Expand All @@ -629,9 +687,9 @@
AB3E9E6326D210B1008FE518 /* Parser */ = {
isa = PBXGroup;
children = (
ABC0A8D026F7037F008EC24C /* IPBanned.html */,
AB3E9E6426D210B1008FE518 /* Gallery */,
AB3E9E6626D210B1008FE518 /* List */,
AB3E9E6426D210B1008FE518 /* Gallery */,
ABD9771127B65F9D00983DE7 /* Other */,
);
path = Parser;
sourceTree = "<group>";
Expand All @@ -640,7 +698,8 @@
isa = PBXGroup;
children = (
AB3E9E6526D210B1008FE518 /* GalleryDetail.html */,
ABF9720926DE6E1300118887 /* GalleryDetailWithGreeting.html */,
AB31CD4027B6769F00F40E0A /* GalleryMPVKeys.html */,
AB31CD3E27B670FD00F40E0A /* GalleryNormalImageURL.html */,
);
path = Gallery;
sourceTree = "<group>";
Expand Down Expand Up @@ -996,6 +1055,25 @@
path = Utilities;
sourceTree = "<group>";
};
ABD9770C27B65A5300983DE7 /* Parser */ = {
isa = PBXGroup;
children = (
AB31CD3327B6674B00F40E0A /* List */,
AB31CD3427B6675100F40E0A /* Gallery */,
AB31CD3527B6675D00F40E0A /* Other */,
);
path = Parser;
sourceTree = "<group>";
};
ABD9771127B65F9D00983DE7 /* Other */ = {
isa = PBXGroup;
children = (
ABF9720926DE6E1300118887 /* GalleryDetailWithGreeting.html */,
ABC0A8D026F7037F008EC24C /* IPBanned.html */,
);
path = Other;
sourceTree = "<group>";
};
ABF45AB325F3312F00ECB568 /* DataFlow */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1268,12 +1346,14 @@
buildActionMask = 2147483647;
files = (
AB3E9E6F26D210B1008FE518 /* Favorites.html in Resources */,
AB31CD4127B6769F00F40E0A /* GalleryMPVKeys.html in Resources */,
ABC0A8D126F7037F008EC24C /* IPBanned.html in Resources */,
ABF9720A26DE6E1300118887 /* GalleryDetailWithGreeting.html in Resources */,
AB3E9E6E26D210B1008FE518 /* GalleryDetail.html in Resources */,
AB30E34826D277F7007420BC /* Toplists.html in Resources */,
AB3E9E7026D210B1008FE518 /* Watched.html in Resources */,
AB3E9E7226D210B1008FE518 /* Popular.html in Resources */,
AB31CD3F27B670FD00F40E0A /* GalleryNormalImageURL.html in Resources */,
AB3E9E7126D210B1008FE518 /* FrontPage.html in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1509,8 +1589,16 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AB3E9E7326D210B1008FE518 /* ParserTests.swift in Sources */,
AB31CD3D27B66F7D00F40E0A /* GalleryImageURLParserTests.swift in Sources */,
AB31CD4327B676C300F40E0A /* GalleryMPVKeysParserTests.swift in Sources */,
AB31CD3027B666E200F40E0A /* TestError.swift in Sources */,
ABD9771027B65E3400983DE7 /* GalleryDetailParserTests.swift in Sources */,
AB31CD3227B6671400F40E0A /* BanIntervalParserTests.swift in Sources */,
ABD9771327B6612400983DE7 /* GreetingParserTests.swift in Sources */,
AB31CD3727B6695800F40E0A /* HTMLFilename.swift in Sources */,
AB3E9E7426D210B1008FE518 /* TestHelper.swift in Sources */,
AB31CD3B27B66E0300F40E0A /* ListParserTestType.swift in Sources */,
ABD9770E27B65A7300983DE7 /* ListParserTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/App/Tools/Clients/CookiesClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ extension CookiesClient {
extension CookiesClient {
private func setCookie(
for url: URL, key: String, value: String, path: String = "/",
expiresTime: TimeInterval = .init(60 * 60 * 24 * 365)
expiresTime: TimeInterval = .oneYear
) {
let expiredDate = Date(timeIntervalSinceNow: expiresTime)
let properties: [HTTPCookiePropertyKey: Any] = [
Expand Down
7 changes: 7 additions & 0 deletions EhPanda/App/Tools/Clients/DatabaseClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,13 @@ extension DatabaseClient {
}
}
}
func removeExpiredImageURLs() -> Effect<Never, Never> {
fetchHistoryGalleries()
.map { $0.filter { Date().timeIntervalSince($0.lastOpenDate ?? .distantPast) > .oneWeek } }
.map { $0.map { removeImageURLs(gid: $0.id) } }
.map(Effect<Never, Never>.merge)
.fireAndForget()
}
func updateThumbnailURLs(gid: String, thumbnailURLs: [Int: URL]) -> Effect<Never, Never> {
guard gid.isValidGID else { return .none }
return updateGalleryState(gid: gid) { galleryStateMO in
Expand Down
1 change: 1 addition & 0 deletions EhPanda/App/Tools/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ struct Defaults {
case act = "act"
case showComments = "hc"
case inlineSet = "inline_set"
case skipServerIdentifier = "nl"

// Search favorites
case sn = "sn"
Expand Down
6 changes: 6 additions & 0 deletions EhPanda/App/Tools/Extensions/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,9 @@ extension Dictionary {
map({ ($0.key, $0.value) })
}
}

// MARK: TimeInterval
extension TimeInterval {
static let oneYear: Self = .init(60 * 60 * 24 * 365)
static let oneWeek: Self = .init(60 * 60 * 24 * 7)
}
12 changes: 3 additions & 9 deletions EhPanda/App/Tools/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import OpenCC

struct Parser {
// MARK: List
static func parseListItems(doc: HTMLDocument) throws -> [Gallery] {
static func parseGalleries(doc: HTMLDocument) throws -> [Gallery] {
func parseCoverURL(node: XMLElement?) throws -> URL {
guard let node = node?.at_xpath("//div [@class='glthumb']")?.at_css("img")
else { throw AppError.parseFailed }
Expand Down Expand Up @@ -563,17 +563,11 @@ struct Parser {
return thumbnailURLs
}

static func parseRenewedThumbnailURL(doc: HTMLDocument, storedThumbnailURL: URL) throws -> URL {
static func parseSkipServerIdentifier(doc: HTMLDocument) throws -> String {
guard let text = doc.at_xpath("//div [@id='i6']")?.at_xpath("//a [@id='loadfail']")?["onclick"],
let rangeA = text.range(of: "nl('"), let rangeB = text.range(of: "')")
else { throw AppError.parseFailed }

let reloadToken = String(text[rangeA.upperBound..<rangeB.lowerBound])
let renewedString = storedThumbnailURL.absoluteString + "?nl=" + reloadToken
guard let renewedThumbnailURL = URL(string: renewedString)
else { throw AppError.parseFailed }

return renewedThumbnailURL
return .init(text[rangeA.upperBound..<rangeB.lowerBound])
}

static func parseGalleryNormalImageURL(doc: HTMLDocument, index: Int) throws -> (Int, URL, URL?) {
Expand Down
4 changes: 4 additions & 0 deletions EhPanda/DataFlow/AppDelegateStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct AppDelegateState: Equatable {

enum AppDelegateAction {
case onLaunchFinish
case removeExpiredImageURLs

case migration(MigrationAction)
}
Expand All @@ -81,6 +82,9 @@ let appDelegateReducer = Reducer<AppState, AppDelegateAction, AppDelegateEnviron
.init(value: .migration(.prepareDatabase))
)

case .removeExpiredImageURLs:
return environment.databaseClient.removeExpiredImageURLs().fireAndForget()

case .migration:
return .none
}
Expand Down
11 changes: 9 additions & 2 deletions EhPanda/DataFlow/AppStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ let appReducerCore = Reducer<AppState, AppAction, AppEnvironment> { state, actio
return .none

case .appDelegate(.migration(.onDatabasePreparationSuccess)):
return .init(value: .setting(.loadUserSettings))
return .merge(
.init(value: .appDelegate(.removeExpiredImageURLs)),
.init(value: .setting(.loadUserSettings))
)

case .appDelegate:
return .none
Expand Down Expand Up @@ -159,7 +162,11 @@ let appReducerCore = Reducer<AppState, AppAction, AppEnvironment> { state, actio
if !environment.cookiesClient.didLogin {
effects.append(
.init(value: .setting(.account(.setNavigation(.login))))
.delay(for: .milliseconds(200), scheduler: DispatchQueue.main).eraseToEffect()
.delay(
for: .milliseconds(environment.deviceClient.isPad() ? 1200 : 200),
scheduler: DispatchQueue.main
)
.eraseToEffect()
)
}
return .merge(effects)
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/Models/Support/AppError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum AppError: Error, Identifiable, Equatable, Hashable {
case unknown
}

extension AppError: LocalizedError {
extension AppError {
var isRetryable: Bool {
switch self {
case .databaseCorrupted, .ipBanned, .networkingFailed, .parseFailed,
Expand Down
Loading

0 comments on commit 3bed4e5

Please sign in to comment.