mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-25 17:12:23 +01:00
Avoid resetting the save timer so often during a refresh session. Instead just remove it (if refreshing) and add it back when the refresh session ends.
This commit is contained in:
parent
0ba557736e
commit
c52eb024ab
@ -46,8 +46,16 @@ public final class Account: DisplayNameProvider, Hashable {
|
||||
var username: String?
|
||||
var saveTimer: Timer?
|
||||
|
||||
private var dirty = false {
|
||||
var dirty = false {
|
||||
didSet {
|
||||
|
||||
if refreshInProgress {
|
||||
if let _ = saveTimer {
|
||||
removeSaveTimer()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if dirty {
|
||||
resetSaveTimer()
|
||||
}
|
||||
@ -65,6 +73,9 @@ public final class Account: DisplayNameProvider, Hashable {
|
||||
}
|
||||
else {
|
||||
NotificationCenter.default.post(name: .AccountRefreshDidFinish, object: self)
|
||||
if dirty {
|
||||
resetSaveTimer()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user