feat: add Finder, ranking reset, and quit actions
This commit is contained in:
@@ -31,6 +31,15 @@ public final class LaunchHistory {
|
||||
if record.count < Int.max { record.count += 1 }
|
||||
record.lastLaunch = timestamp
|
||||
usage[application.id] = record
|
||||
save()
|
||||
}
|
||||
|
||||
public func resetRanking(of application: Application) {
|
||||
usage.removeValue(forKey: application.id)
|
||||
save()
|
||||
}
|
||||
|
||||
private func save() {
|
||||
var saved: [String: [String: Any]] = [:]
|
||||
saved.reserveCapacity(usage.count)
|
||||
for (url, record) in usage {
|
||||
|
||||
Reference in New Issue
Block a user