mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-03-11 13:26:17 +00:00
added deleteAllStickers
fix crash when the uiimage isnt valid swift 6 in the messages extension added fakedownloadallstickers test added deleteallimages test
This commit is contained in:
@@ -694,7 +694,7 @@
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
SWIFT_VERSION = 6.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -726,7 +726,7 @@
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
SWIFT_VERSION = 6.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
|
||||
@@ -37,6 +37,17 @@ class EmojiHoarder: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func deleteAllStickers() async {
|
||||
await withTaskGroup { group in
|
||||
for emoji in emojis {
|
||||
group.addTask {
|
||||
guard await emoji.isLocal else { return }
|
||||
await emoji.deleteImage()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func storeDB() {
|
||||
try! encoder.encode(emojis).write(to: EmojiHoarder.localEmojiDB)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ struct EmojiPreview: View {
|
||||
Text(emoji.name)
|
||||
Group {
|
||||
if emoji.isLocal {
|
||||
Image(uiImage: emoji.image!)
|
||||
Image(uiImage: emoji.image ?? UIImage())
|
||||
.resizable().scaledToFit()
|
||||
.border(.orange)
|
||||
.overlay(alignment: .bottomLeading) {
|
||||
|
||||
@@ -131,4 +131,24 @@ struct PerformanceTests {
|
||||
try! await doThing(on: emoji, i: &i)
|
||||
}
|
||||
}
|
||||
|
||||
@Test func fakeDownloadAllStickers() async throws {
|
||||
await withDiscardingTaskGroup { group in
|
||||
for emoji in hoarder.emojis {
|
||||
group.addTask {
|
||||
try! Data().write(to: emoji.localImageURL)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test func deleteAllImages() async throws {
|
||||
await withDiscardingTaskGroup { group in
|
||||
for emoji in hoarder.emojis {
|
||||
group.addTask {
|
||||
emoji.deleteImage()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user