mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
ui updates to emojpackdetailview
added .type to sticker to get its type added fromappname to stickertype
This commit is contained in:
8 files changed
+45
-33
No files matched your search
@@ -11,12 +11,11 @@ import Messages
|
||||
extension StickerProtocol {
|
||||
var localImageURLString: String {
|
||||
let containerPath: String
|
||||
if type(of: self) == Emoji.self {
|
||||
switch type {
|
||||
case .slackEmoji:
|
||||
containerPath = EmojiHoarder.container.safePath
|
||||
} else if type(of: self) == Gif.self {
|
||||
case .giphyGifs:
|
||||
containerPath = GifHoarder.container.safePath
|
||||
} else {
|
||||
fatalError("sticker type unrecogniesd")
|
||||
}
|
||||
let urlString = remoteImageURL.absoluteString
|
||||
let split = urlString.split(separator: ".")
|
||||
@@ -49,6 +48,17 @@ extension StickerProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
var type: StickerType {
|
||||
let typeOfSelf = Swift.type(of: self)
|
||||
if typeOfSelf == Emoji.self {
|
||||
return .slackEmoji
|
||||
} else if typeOfSelf == Gif.self {
|
||||
return .giphyGifs
|
||||
} else {
|
||||
fatalError("unrecognised sticker type get crashed lmfao")
|
||||
}
|
||||
}
|
||||
|
||||
nonisolated
|
||||
func downloadImage() async throws {
|
||||
if let data = try? await Data(contentsOf: localImageURL),
|
||||
|
||||