Skip to content

Commit

Permalink
Verify that the client is v3 enabled first
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalzieu committed Aug 9, 2024
1 parent 65af5a9 commit dd9fb5d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ios/XMTPModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,20 @@ public class XMTPModule: Module {
// A method to disconnect all dbs
func dropAllLocalDatabaseConnections() throws {
for (_, client) in clients {
// Call the method on each client
try client.dropLocalDatabaseConnection()
// Call the drop method on each v3 client
if (!client.installationID.isEmpty) {
try client.dropLocalDatabaseConnection()
}
}
}

// A method to reconnect all dbs
func reconnectAllLocalDatabaseConnections() async throws {
for (_, client) in clients {
// Call the method on each client
try await client.reconnectLocalDatabase()
// Call the reconnect method on each v3 client
if (!client.installationID.isEmpty) {
try await client.reconnectLocalDatabase()
}
}
}
}
Expand Down

0 comments on commit dd9fb5d

Please sign in to comment.