Skip to content

Commit

Permalink
fix: Add "e" to "syncMod"
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptGrv committed Oct 4, 2024
1 parent 006432d commit 31e8a01
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
16 changes: 8 additions & 8 deletions Tuist/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core.git",
"state" : {
"revision" : "b36f2436c2746c32b1f93dcc06ea8b859671a767",
"version" : "14.12.1"
"revision" : "e474a8d2270a8b12ac63ac9504e4757e39814b99",
"version" : "14.13.0"
}
},
{
"identity" : "realm-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-swift",
"state" : {
"revision" : "9b9992d59a5148eb557e6c0445fec05009022c8c",
"version" : "10.53.1"
"revision" : "863498d37a9f0e72caa65963da9641d8cdfc8228",
"version" : "10.54.0"
}
},
{
Expand Down Expand Up @@ -275,8 +275,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
"version" : "1.1.3"
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
"version" : "1.1.4"
}
},
{
Expand All @@ -302,8 +302,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "9746cf80e29edfef2a39924a66731249223f42a3",
"version" : "2.72.0"
"revision" : "665206000b8307cab5ac51203d29b0f232d7e31b",
"version" : "2.74.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions kDrive/UI/Controller/Menu/ParameterTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ class ParameterTableViewController: BaseGroupedTableViewController {
case .wifi:
let cell = tableView.dequeueReusableCell(type: AboutDetailTableViewCell.self, for: indexPath)
cell.initWithPositionAndShadow(isFirst: indexPath.row == 0, isLast: indexPath.row == tableContent.count - 1)
cell.titleLabel.text = UserDefaults.shared.syncMod.title
cell.detailLabel.text = UserDefaults.shared.syncMod.selectionTitle
cell.titleLabel.text = UserDefaults.shared.syncMode.title
cell.detailLabel.text = UserDefaults.shared.syncMode.selectionTitle
return cell
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ extension PhotoSyncSettingsViewController {
let cell = tableView.dequeueReusableCell(type: AboutDetailTableViewCell.self, for: indexPath)
cell.initWithPositionAndShadow(isFirst: indexPath.row == 0, isLast: indexPath.row == settingsRows.count - 1)
cell.titleLabel.text = KDriveResourcesStrings.Localizable.syncWifiPicturesTitle
cell.detailLabel.text = UserDefaults.shared.syncMod.title
cell.detailLabel.text = UserDefaults.shared.syncMode.title
return cell
}
case .syncDenied:
Expand Down Expand Up @@ -566,7 +566,7 @@ extension PhotoSyncSettingsViewController: PhotoSyncSettingsTableViewCellDelegat
}

extension PhotoSyncSettingsViewController: WifiSyncSettingsDelegate {
func didSelectSyncMod(_ mod: SyncMod) {
func didSelectSyncMode(_ mod: SyncMode) {
newSyncSettings.wifiSync = mod
tableView.reloadRows(at: [IndexPath(row: 7, section: 2)], with: .fade)
}
Expand Down
18 changes: 9 additions & 9 deletions kDrive/UI/Controller/Menu/WifiSyncSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ import kDriveResources
import UIKit

protocol WifiSyncSettingsDelegate: AnyObject {
func didSelectSyncMod(_ mod: SyncMod)
func didSelectSyncMode(_ mod: SyncMode)
}

class WifiSyncSettingsViewController: BaseGroupedTableViewController {
@LazyInjectService private var appNavigable: AppNavigable

private var tableContent: [SyncMod] = SyncMod.allCases
private var selectedMod: SyncMod!
private var tableContent: [SyncMode] = SyncMode.allCases
private var selectedMod: SyncMode!
weak var delegate: WifiSyncSettingsDelegate?

override func viewDidLoad() {
Expand All @@ -41,10 +41,10 @@ class WifiSyncSettingsViewController: BaseGroupedTableViewController {
tableView.register(cellView: ParameterSyncTableViewCell.self)
tableView.allowsMultipleSelection = false

selectedMod = UserDefaults.shared.syncMod
selectedMod = UserDefaults.shared.syncMode
}

static func instantiate(selectedMod: SyncMod) -> WifiSyncSettingsViewController {
static func instantiate(selectedMod: SyncMode) -> WifiSyncSettingsViewController {
let viewController = WifiSyncSettingsViewController()
viewController.selectedMod = selectedMod
return viewController
Expand Down Expand Up @@ -76,10 +76,10 @@ class WifiSyncSettingsViewController: BaseGroupedTableViewController {
}

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let mod = tableContent[indexPath.row]
MatomoUtils.track(eventWithCategory: .settings, name: "mod\(mod.rawValue.capitalized)")
UserDefaults.shared.syncMod = mod
delegate?.didSelectSyncMod(tableContent[indexPath.row])
let mode = tableContent[indexPath.row]
MatomoUtils.track(eventWithCategory: .settings, name: "mod\(mode.rawValue.capitalized)")
UserDefaults.shared.syncMode = mode
delegate?.didSelectSyncMode(tableContent[indexPath.row])
navigationController?.popViewController(animated: true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ public class DriveFileManagerConstants {
return
}
if UserDefaults.shared.isWifiOnly {
newObject["wifiSync"] = SyncMod.onlyWifi
newObject["wifiSync"] = SyncMode.onlyWifi
} else {
newObject["wifiSync"] = SyncMod.wifiAndMobileData
newObject["wifiSync"] = SyncMode.wifiAndMobileData
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions kDriveCore/Data/Cache/PhotoSyncSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final class PhotoSyncSettings: Object {
@Persisted public var createDatedSubFolders = false
@Persisted public var deleteAssetsAfterImport = false
@Persisted public var photoFormat: PhotoFileFormat = .jpg
@Persisted public var wifiSync: SyncMod = .wifiAndMobileData
@Persisted public var wifiSync: SyncMode = .wifiAndMobileData

public init(userId: Int,
driveId: Int,
Expand All @@ -64,7 +64,7 @@ public final class PhotoSyncSettings: Object {
createDatedSubFolders: Bool,
deleteAssetsAfterImport: Bool,
photoFormat: PhotoFileFormat,
wifiSync: SyncMod) {
wifiSync: SyncMode) {
super.init()
self.userId = userId
self.driveId = driveId
Expand Down
10 changes: 5 additions & 5 deletions kDriveCore/Utils/DriveUserDefaults+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extension UserDefaults.Keys {
static let selectedHomeIndex = UserDefaults.Keys(rawValue: "selectedHomeIndex")
static let fpStorageVersion = UserDefaults.Keys(rawValue: "fpStorageVersion")
static let importPhotoFormat = UserDefaults.Keys(rawValue: "importPhotoFormat")
static let syncMod = UserDefaults.Keys(rawValue: "syncMod")
static let syncMode = UserDefaults.Keys(rawValue: "syncMode")
}

public extension UserDefaults {
Expand Down Expand Up @@ -338,16 +338,16 @@ public extension UserDefaults {
}
}

var syncMod: SyncMod {
var syncMode: SyncMode {
get {
if let rawValue = object(forKey: key(.syncMod)) as? String,
let mod = SyncMod(rawValue: rawValue) {
if let rawValue = object(forKey: key(.syncMode)) as? String,
let mod = SyncMode(rawValue: rawValue) {
return mod
}
return .onlyWifi
}
set {
set(newValue.rawValue, forKey: key(.syncMod))
set(newValue.rawValue, forKey: key(.syncMode))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import kDriveResources
import UIKit
import RealmSwift

public enum SyncMod: String, CaseIterable, PersistableEnum {
public enum SyncMode: String, CaseIterable, PersistableEnum {
case onlyWifi
case wifiAndMobileData

Expand Down

0 comments on commit 31e8a01

Please sign in to comment.