fixed unnecesary reloads

This commit is contained in:
Nihaal Sharma committed 2026-04-29 22:09:21 +01:00
1 parent a62a663a6d
commit 53aa8fa0ed
2 files changed
+5 -21

No files matched your search

@@ -9,7 +9,7 @@ import Foundation
import SwiftUI
import UniformTypeIdentifiers
struct EmojiPack: Identifiable, Codable {
struct EmojiPack: Identifiable, Codable, Equatable {
var id: UUID
var name: String
var description: String
@@ -29,16 +29,6 @@ struct EmojiPack: Identifiable, Codable {
url.safeHost == "stickerslack.nihaals.me" else {
return nil
}
// switch url.safeHost {
// case "shared.pack":
// <#code#>
// case "stickerslack.neon443.xyz":
// <#code#>
// case "stickerslack.nihaals.me":
// <#code#>
// default:
// return nil
// }
guard let created = EmojiPack.createFrom(url: url) else {
return nil
}
@@ -48,14 +38,6 @@ struct EmojiPack: Identifiable, Codable {
static func createFrom(url: URL) -> EmojiPack? {
var pack: EmojiPack = .new()
// switch type {
// case .stickerslack:
// <#code#>
// case .neon443:
// <#code#>
// case .nihaals:
// <#code#>
// }
guard let components = URLComponents(string: url.absoluteString),
let queryItems = components.queryItems else {
print("no query items or components")
@@ -30,12 +30,14 @@ struct EmojiCollectionView: UIViewRepresentable {
func updateUIView(_ uiView: UICollectionView, context: Context) {
context.coordinator.hoarder = hoarder
context.coordinator.items = items
context.coordinator.pack = pack
context.coordinator.edit = edit
context.coordinator.onRemove = onRemove
if items != context.coordinator.items || context.coordinator.pack != pack {
context.coordinator.items = items
context.coordinator.pack = pack
uiView.reloadData()
}
}
func makeCoordinator() -> Coordinator {
Coordinator(
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.