Sort sticker packs in sticker management view.
This commit is contained in:
parent
ddb5e6c1d6
commit
55ef7bd02f
2
Pods
2
Pods
@ -1 +1 @@
|
||||
Subproject commit 46a69a1e7794ebf156f29b252208691dc980bd3f
|
||||
Subproject commit 4f7bfae49edd3ad1225837da518882f0eff1aec4
|
||||
@ -104,8 +104,12 @@ public class ManageStickersViewController: OWSTableViewController {
|
||||
private var availableStickerPacks = [StickerPack]()
|
||||
|
||||
private func updateState() {
|
||||
installedStickerPacks = StickerManager.installedStickerPacks()
|
||||
availableStickerPacks = StickerManager.availableStickerPacks()
|
||||
installedStickerPacks = StickerManager.installedStickerPacks().sorted {
|
||||
$0.dateSaved > $1.dateSaved
|
||||
}
|
||||
availableStickerPacks = StickerManager.availableStickerPacks().sorted {
|
||||
$0.dateSaved > $1.dateSaved
|
||||
}
|
||||
|
||||
updateTableContents()
|
||||
}
|
||||
|
||||
@ -823,16 +823,22 @@ public class StickerManager: NSObject {
|
||||
#if DEBUG
|
||||
@objc
|
||||
public class func uninstallAllStickerPacks() {
|
||||
var stickerPacks = [StickerPack]()
|
||||
databaseStorage.write { (_) in
|
||||
stickerPacks = installedStickerPacks()
|
||||
}
|
||||
|
||||
let stickerPacks = installedStickerPacks()
|
||||
for stickerPack in stickerPacks {
|
||||
uninstallStickerPack(stickerPackInfo: stickerPack.info)
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
public class func removeAllStickerPacks() {
|
||||
let stickerPacks = allStickerPacks()
|
||||
databaseStorage.write { (transaction) in
|
||||
for stickerPack in stickerPacks {
|
||||
stickerPack.anyRemove(transaction: transaction)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
public class func tryToInstallAllAvailableStickerPacks() {
|
||||
databaseStorage.write { (transaction) in
|
||||
|
||||
19
SignalServiceKit/src/Util/Date+SSK.swift
Normal file
19
SignalServiceKit/src/Util/Date+SSK.swift
Normal file
@ -0,0 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objc
|
||||
public extension NSDate {
|
||||
@objc
|
||||
var ows_millisecondsSince1970: UInt64 {
|
||||
return NSDate.ows_millisecondsSince1970(for: self as Date)
|
||||
}
|
||||
}
|
||||
|
||||
public extension Date {
|
||||
var ows_millisecondsSince1970: UInt64 {
|
||||
return (self as NSDate).ows_millisecondsSince1970
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user