improve handling of user invitation

This commit is contained in:
2026-05-16 14:27:00 +02:00
parent 10e08435a7
commit c55b8e38ca
@@ -47,12 +47,12 @@ final class NoteEditingSessionServer: NSObject {
}
func invite(peer: Peer, to note: NoteInvitation.NoteContent) {
guard peer.state == .available else { return }
guard peer.state == .available, let note = try? JSONEncoder().encode(note) else { return }
browser.invitePeer(
peer.mcPeer,
to: session,
withContext: try! JSONEncoder().encode(note),
timeout: 5
withContext: note,
timeout: 600
)
guard let idxToUpdate = visiblePeers.firstIndex(where: { $0.mcPeer == peer.mcPeer }) else { return }
visiblePeers[idxToUpdate].state = .invitationPending