Skip to content

Commit

Permalink
Bug fixes after testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisevener committed Oct 7, 2024
1 parent 18e2f74 commit 9168a5e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import Foundation

// MARK: - Remote Settings from donatewiki AppsFeatureConfig json

func loadFeatureConfig() -> WMFFeatureConfigResponse? {
public func loadFeatureConfig() -> WMFFeatureConfigResponse? {

// First pull from memory
guard featureConfig == nil else {
Expand Down Expand Up @@ -107,7 +107,12 @@ import Foundation
self.featureConfig = response
self.featureConfig?.cachedDate = Date()

try? self.sharedCacheStore?.save(key: self.cacheDirectoryName, self.cacheFeatureConfigFileName, value: featureConfig)
do {
try self.sharedCacheStore?.save(key: self.cacheDirectoryName, self.cacheFeatureConfigFileName, value: featureConfig)
} catch {
print(error)
}


completion(nil)
case .failure(let error):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import Foundation

struct WMFFeatureConfigResponse: Codable {
struct FeatureConfigIOS: Codable {
public struct WMFFeatureConfigResponse: Codable {
public struct FeatureConfigIOS: Codable {

struct Slide: Codable {
let id: String
let isEnabled: Bool
public struct Slide: Codable {
public let id: String
public let isEnabled: Bool
}

let version: Int
let yirIsEnabled: Bool
let yirCountryCodes: [String]
let yirPrimaryAppLanguageCodes: [String]
let yirDataPopulationStartDateString: String
let yirDataPopulationEndDateString: String
let yirDataPopulationFetchMaxPagesPerSession: Int
let yirPersonalizedSlides: [Slide]
public let yirIsEnabled: Bool
public let yirCountryCodes: [String]
public let yirPrimaryAppLanguageCodes: [String]
public let yirDataPopulationStartDateString: String
public let yirDataPopulationEndDateString: String
public let yirDataPopulationFetchMaxPagesPerSession: Int
public let yirPersonalizedSlides: [Slide]
}

let ios: [FeatureConfigIOS]
public let ios: [FeatureConfigIOS]
var cachedDate: Date?

private let currentFeatureConfigVersion = 1
Expand Down Expand Up @@ -64,5 +64,6 @@ struct WMFFeatureConfigResponse: Codable {
}

self.ios = validConfigs
self.cachedDate = try? overallContainer.decode(Date.self, forKey: .cachedDate)
}
}
2 changes: 1 addition & 1 deletion Wikipedia/Code/WMFAppViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,9 @@ - (void)migrateIfNecessary {
self.migrationComplete = YES;
self.migrationActive = NO;
[self endMigrationBackgroundTask];
[self setupWMFDataEnvironment];
[self checkRemoteAppConfigIfNecessary];
[self setupControllers];
[self setupWMFDataEnvironment];
if (!self.isWaitingToResumeApp) {
[self resumeApp:NULL];
}
Expand Down

0 comments on commit 9168a5e

Please sign in to comment.