mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-26 17:43:22 +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 username: String?
|
||||||
var saveTimer: Timer?
|
var saveTimer: Timer?
|
||||||
|
|
||||||
private var dirty = false {
|
var dirty = false {
|
||||||
didSet {
|
didSet {
|
||||||
|
|
||||||
|
if refreshInProgress {
|
||||||
|
if let _ = saveTimer {
|
||||||
|
removeSaveTimer()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if dirty {
|
if dirty {
|
||||||
resetSaveTimer()
|
resetSaveTimer()
|
||||||
}
|
}
|
||||||
@ -65,6 +73,9 @@ public final class Account: DisplayNameProvider, Hashable {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NotificationCenter.default.post(name: .AccountRefreshDidFinish, object: self)
|
NotificationCenter.default.post(name: .AccountRefreshDidFinish, object: self)
|
||||||
|
if dirty {
|
||||||
|
resetSaveTimer()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user