mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Add LocalSend support with service integration and UI updates
This commit is contained in:
parent
6bc3af0431
commit
f345ddaff8
15 changed files with 1773 additions and 29 deletions
|
|
@ -49,19 +49,25 @@ final class ShelfStateViewModel: ObservableObject {
|
|||
var merged = items
|
||||
// Deduplicate by identityKey while preserving order (existing first)
|
||||
var seen: Set<String> = Set(merged.map { $0.identityKey })
|
||||
var addedIDs: [String] = []
|
||||
for it in newItems {
|
||||
let key = it.identityKey
|
||||
if !seen.contains(key) {
|
||||
merged.append(it)
|
||||
seen.insert(key)
|
||||
addedIDs.append(it.id.uuidString)
|
||||
}
|
||||
}
|
||||
items = merged
|
||||
if !addedIDs.isEmpty {
|
||||
ExtensionRPCServer.shared.notifyShelfItemsChanged(itemIDs: addedIDs, action: "added")
|
||||
}
|
||||
}
|
||||
|
||||
func remove(_ item: ShelfItem) {
|
||||
item.cleanupStoredData()
|
||||
items.removeAll { $0.id == item.id }
|
||||
ExtensionRPCServer.shared.notifyShelfItemsChanged(itemIDs: [item.id.uuidString], action: "removed")
|
||||
}
|
||||
|
||||
func updateBookmark(for item: ShelfItem, bookmark: Data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue