mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Expose the current device identifier in settings (#442)
This commit is contained in:
@@ -26,6 +26,7 @@ enum SettingsViewModelAction {
|
|||||||
|
|
||||||
struct SettingsViewState: BindableState {
|
struct SettingsViewState: BindableState {
|
||||||
var bindings: SettingsViewStateBindings
|
var bindings: SettingsViewStateBindings
|
||||||
|
var deviceID: String?
|
||||||
var userID: String
|
var userID: String
|
||||||
var userAvatar: UIImage?
|
var userAvatar: UIImage?
|
||||||
var userDisplayName: String?
|
var userDisplayName: String?
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class SettingsViewModel: SettingsViewModelType, SettingsViewModelProtocol {
|
|||||||
init(withUserSession userSession: UserSessionProtocol) {
|
init(withUserSession userSession: UserSessionProtocol) {
|
||||||
self.userSession = userSession
|
self.userSession = userSession
|
||||||
let bindings = SettingsViewStateBindings()
|
let bindings = SettingsViewStateBindings()
|
||||||
super.init(initialViewState: .init(bindings: bindings, userID: userSession.userID))
|
super.init(initialViewState: .init(bindings: bindings, deviceID: userSession.deviceId, userID: userSession.userID))
|
||||||
|
|
||||||
Task {
|
Task {
|
||||||
if case let .success(userAvatarURLString) = await userSession.clientProxy.loadUserAvatarURLString() {
|
if case let .success(userAvatarURLString) = await userSession.clientProxy.loadUserAvatarURLString() {
|
||||||
|
|||||||
@@ -155,8 +155,14 @@ struct SettingsScreen: View {
|
|||||||
Text(ElementL10n.actionSignOutConfirmationSimple)
|
Text(ElementL10n.actionSignOutConfirmationSimple)
|
||||||
}
|
}
|
||||||
} footer: {
|
} footer: {
|
||||||
versionText
|
VStack {
|
||||||
.frame(maxWidth: .infinity)
|
versionText
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
|
||||||
|
if let deviceId = context.viewState.deviceID {
|
||||||
|
Text(deviceId)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user