remove the rror state for stickers cos icba and fixed random divider on the packmanager

This commit is contained in:
neon443 committed 2026-04-08 19:29:27 +01:00
1 parent 88b21dfdc7
commit e3436f1fc9
2 files changed
+7 -17

No files matched your search

@@ -30,6 +30,7 @@ struct EmojiPackManager: View {
.tint(.red) .tint(.red)
} }
} }
Spacer()
NavigationLink { NavigationLink {
EmojiPackDetailView(hoarder: hoarder, pack: .constant(.test)) EmojiPackDetailView(hoarder: hoarder, pack: .constant(.test))
} label: { } label: {
@@ -50,7 +51,6 @@ struct EmojiPackManager: View {
} }
} }
} }
Divider()
} }
} }
+6 -16
View File
@@ -16,8 +16,6 @@ struct GifView: View {
@State var currentI: Int = 0 @State var currentI: Int = 0
@State var timer: Timer? @State var timer: Timer?
@State var error: Error?
@State var failed: Bool = false
func run() async { func run() async {
do { do {
@@ -28,15 +26,11 @@ struct GifView: View {
} }
} }
} catch { } catch {
self.error = error print(error)
} print(error.localizedDescription)
guard self.error == nil && !self.gif.isEmpty else {
print("falied loading or empty gif") print("falied loading or empty gif")
withAnimation(.spring) { self.failed = true }
return return
} }
guard gif.count > 0 else { return }
if timer != nil { if timer != nil {
timer!.invalidate() timer!.invalidate()
timer = nil timer = nil
@@ -56,16 +50,10 @@ struct GifView: View {
// /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Hello, world!@*/Text("Hello, world!")/*@END_MENU_TOKEN@*/ // /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Hello, world!@*/Text("Hello, world!")/*@END_MENU_TOKEN@*/
TimelineView(.animation) { tl in TimelineView(.animation) { tl in
VStack { VStack {
if gif.isEmpty && error == nil { if gif.isEmpty {
ProgressView() ProgressView()
.controlSize(.large) .controlSize(.large)
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
} else if failed {
Image(systemName: "xmark")
.resizable().scaledToFit()
.padding()
.padding()
.background(.red)
} else { } else {
if currentI < gif.count { if currentI < gif.count {
let image = Image(uiImage: .init(cgImage: gif[currentI].frame)) let image = Image(uiImage: .init(cgImage: gif[currentI].frame))
@@ -80,10 +68,12 @@ struct GifView: View {
timer?.invalidate() timer?.invalidate()
timer = nil timer = nil
} }
.task { .onAppear {
Task {
await run() await run()
} }
} }
}
} }
#Preview { #Preview {
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.