mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-01 18:23:03 +00:00
Add a developer option button for marking every single room as read (#5582)
This will use an underlying SDK method and send a private read receipt plus a fully read marker in every single room the user is part of. It will most likely be a long operation that will get rate limited so the task is set to run detached for as long as it takes.
This commit is contained in:
+7
@@ -18,7 +18,10 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
private let clientProxy: ClientProxyProtocol?
|
||||
|
||||
init(developerOptions: DeveloperOptionsProtocol, elementCallBaseURL: URL, appHooks: AppHooks, clientProxy: ClientProxyProtocol?) {
|
||||
self.clientProxy = clientProxy
|
||||
super.init(initialViewState: .init(elementCallBaseURL: elementCallBaseURL,
|
||||
appHooks: appHooks,
|
||||
shouldShowClearCache: clientProxy != nil,
|
||||
@@ -55,6 +58,10 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
|
||||
switch viewAction {
|
||||
case .clearCache:
|
||||
actionsSubject.send(.clearCache)
|
||||
case .markAllRoomsAsRead:
|
||||
Task.detached {
|
||||
await self.clientProxy?.markAllRoomsAsRead()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user