Skip to content

Commit c7bcd33

Browse files
Do not throw error on idempotent calls
1 parent e63af86 commit c7bcd33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/LiveViewNative/Coordinators/LiveSessionCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class LiveSessionCoordinator<R: RootRegistry>: ObservableObject {
112112
$navigationPath.scan(([LiveNavigationEntry<R>](), [LiveNavigationEntry<R>]()), { ($0.1, $1) }).sink { [weak self] prev, next in
113113
guard let self else { return }
114114
Task {
115-
try await prev.last?.coordinator.disconnect()
115+
try? await prev.last?.coordinator.disconnect()
116116
if prev.count > next.count {
117117
let targetEntry = self.liveSocket!.getEntries()[next.count - 1]
118118
next.last?.coordinator.join(
@@ -336,7 +336,7 @@ public class LiveSessionCoordinator<R: RootRegistry>: ObservableObject {
336336
private func disconnect(preserveNavigationPath: Bool = false) async {
337337
do {
338338
for entry in self.navigationPath {
339-
try await entry.coordinator.disconnect()
339+
try? await entry.coordinator.disconnect()
340340
if !preserveNavigationPath {
341341
entry.coordinator.document = nil
342342
}

0 commit comments

Comments
 (0)