Commit 24887ef3 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

fix: device revocation for a new account

Change-Id: I3a2bff584ea036f86178e2705bcab7dc71b2eeb5
parent 7eefa6a9
...@@ -206,7 +206,21 @@ class MeViewModel: ViewModel, Stateable { ...@@ -206,7 +206,21 @@ class MeViewModel: ViewModel, Stateable {
required init (with injectionBag: InjectionBag) { required init (with injectionBag: InjectionBag) {
self.accountService = injectionBag.accountService self.accountService = injectionBag.accountService
self.nameService = injectionBag.nameService self.nameService = injectionBag.nameService
guard let accountId = self.accountService.currentAccount?.id else {return} }
func linkDevice() {
self.stateSubject.onNext(MeState.linkNewDevice)
}
func showBlockedContacts() {
self.stateSubject.onNext(MeState.blockedContacts)
}
func revokeDevice(deviceId: String, accountPassword password: String) {
guard let accountId = self.accountService.currentAccount?.id else {
self.showActionState.value = .hideLoading
return
}
self.accountService.sharedResponseStream self.accountService.sharedResponseStream
.filter({ (deviceEvent) -> Bool in .filter({ (deviceEvent) -> Bool in
return deviceEvent.eventType == ServiceEventType.deviceRevocationEnded return deviceEvent.eventType == ServiceEventType.deviceRevocationEnded
...@@ -227,21 +241,6 @@ class MeViewModel: ViewModel, Stateable { ...@@ -227,21 +241,6 @@ class MeViewModel: ViewModel, Stateable {
} }
} }
}).disposed(by: self.disposeBag) }).disposed(by: self.disposeBag)
}
func linkDevice() {
self.stateSubject.onNext(MeState.linkNewDevice)
}
func showBlockedContacts() {
self.stateSubject.onNext(MeState.blockedContacts)
}
func revokeDevice(deviceId: String, accountPassword password: String) {
guard let accountId = self.accountService.currentAccount?.id else {
self.showActionState.value = .hideLoading
return
}
self.accountService.revokeDevice(for: accountId, withPassword: password, deviceId: deviceId) self.accountService.revokeDevice(for: accountId, withPassword: password, deviceId: deviceId)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment