-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Sync of photos wifiOnly #1313
base: Update-feature-wifi-only
Are you sure you want to change the base?
Conversation
Quality Gate failedFailed conditions |
f05c24b
to
e5219ab
Compare
Quality Gate failedFailed conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to discuss the behaviour when the queue is suspended.
Right now your PR puts all the uploads in an error state, also this could be costly when dealing with a large upload queue.
|
||
class OfflineSyncSettingsViewController: BaseGroupedTableViewController { | ||
private var tableContent: [SyncMode] = SyncMode.allCases | ||
private var selectedOfflineMod: SyncMode! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really should not use force unwrap. You could provide a default value for instance or make it lazy / computed property to make it work.
} | ||
|
||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
let mod = tableContent[indexPath.row] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode
@@ -66,19 +64,18 @@ class WifiSyncSettingsViewController: BaseGroupedTableViewController { | |||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |||
let cell = tableView.dequeueReusableCell(type: ParameterSyncTableViewCell.self, for: indexPath) | |||
cell.initWithPositionAndShadow(isFirst: true, isLast: true) | |||
let currentMode = tableContent[indexPath.row] | |||
if currentMode == selectedMode { | |||
let currentMod = tableContent[indexPath.row] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode
let mode = tableContent[indexPath.row] | ||
MatomoUtils.track(eventWithCategory: .settings, name: "mode\(mode.rawValue.capitalized)") | ||
UserDefaults.shared.syncMode = mode | ||
let mod = tableContent[indexPath.row] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode
@@ -338,16 +338,16 @@ public extension UserDefaults { | |||
} | |||
} | |||
|
|||
var syncMode: SyncMode { | |||
var syncOfflineMod: SyncMode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode
@@ -56,4 +57,22 @@ extension UploadOperation { | |||
file.pathURL = url | |||
} | |||
} | |||
|
|||
func checkForRestrictedUploadOverDataMode() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not found of this, can we keep it in UploadQueue ? We do not want to put each upload in error, do we ?
The behaviour until now was the upload queue would not start. We need to discuss this together at least.
Feature PR here #1310