mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-16 06:49:03 +00:00
ios get address on start
This commit is contained in:
@@ -19,6 +19,7 @@ struct ContentView: View {
|
||||
do {
|
||||
try apiStartChat()
|
||||
try apiSetFilesFolder(filesFolder: getAppFilesDirectory().path)
|
||||
chatModel.userAddress = try apiGetUserAddress()
|
||||
chatModel.userSMPServers = try getUserSMPServers()
|
||||
chatModel.chats = try apiGetChats()
|
||||
} catch {
|
||||
|
||||
@@ -520,8 +520,8 @@ func apiDeleteUserAddress() async throws {
|
||||
throw r
|
||||
}
|
||||
|
||||
func apiGetUserAddress() async throws -> String? {
|
||||
let r = await chatSendCmd(.showMyAddress)
|
||||
func apiGetUserAddress() throws -> String? {
|
||||
let r = chatSendCmdSync(.showMyAddress)
|
||||
switch r {
|
||||
case let .userContactLink(connReq):
|
||||
return connReq
|
||||
|
||||
@@ -18,18 +18,6 @@ struct SettingsButton: View {
|
||||
}
|
||||
.sheet(isPresented: $showSettings, content: {
|
||||
SettingsView(showSettings: $showSettings)
|
||||
.onAppear {
|
||||
Task {
|
||||
do {
|
||||
let userAddress = try await apiGetUserAddress()
|
||||
DispatchQueue.main.async {
|
||||
chatModel.userAddress = userAddress
|
||||
}
|
||||
} catch {
|
||||
logger.error("SettingsButton apiGetUserAddress error: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user