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:
neon443 committed 2025-10-31 15:57:40 +00:00
1 parent a55c4b8c31
commit bf3ac0eb3b
4 files changed
+34 -3

No files matched your search

+2 -2
View File
@@ -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;
};
+11
View File
@@ -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)
}
+1 -1
View File
@@ -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) {
+20
View File
@@ -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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.