Files
simplex-chat/apps/ios/Shared/Views/UserSettings/SettingsButton.swift
T
Evgeny Poberezkin 516c8d79ad receiving messages in the background and sending local notifications (#284)
* receiving messages in the background and sending local notifications

* show notifications in foreground and background

* presentation logic for notification options when app is in the foreground

* background refresh works

* remove async dispatch
2022-02-09 22:53:06 +00:00

37 lines
944 B
Swift

//
// SettingsButton.swift
// SimpleX
//
// Created by Evgeny Poberezkin on 31/01/2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
import SwiftUI
struct SettingsButton: View {
@EnvironmentObject var chatModel: ChatModel
@State private var showSettings = false
var body: some View {
Button { showSettings = true } label: {
Image(systemName: "gearshape")
}
.sheet(isPresented: $showSettings, content: {
SettingsView()
.onAppear {
do {
chatModel.userAddress = try apiGetUserAddress()
} catch {
logger.error("SettingsButton apiGetUserAddress error: \(error.localizedDescription)")
}
}
})
}
}
struct SettingsButton_Previews: PreviewProvider {
static var previews: some View {
SettingsButton()
}
}