File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Sources/LiveViewNative/Coordinators Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,10 @@ public class LiveViewCoordinator<R: RootRegistry>: ObservableObject {
272272 switch event. event {
273273 case . phoenix( phoenix: . error) :
274274 logger. error ( " encountered error in reply - channel reconnecting " ) ;
275+ if let liveChannel {
276+ let channel = liveChannel. channel ( )
277+ try await channel. shutdown ( )
278+ }
275279 try await session. joinLiveViewChannel ( )
276280 case . user( user: " diff " ) :
277281 switch event. payload {
@@ -345,12 +349,6 @@ public class LiveViewCoordinator<R: RootRegistry>: ObservableObject {
345349 }
346350
347351 func join( _ liveChannel: LiveViewNativeCore . LiveChannel ) {
348- if let old = self . liveChannel {
349- let channel = old. channel ( )
350- Task { @MainActor in
351- try await channel. shutdown ( )
352- }
353- }
354352
355353 self . liveChannel = liveChannel
356354 let channel = liveChannel. channel ( )
You can’t perform that action at this time.
0 commit comments