Skip to content

Commit

Permalink
Dismiss the launching screen when clearing cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Sep 13, 2022
1 parent a12ef01 commit 6f92a65
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Riot/Modules/Home/AllChats/AllChatsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,22 @@ class AllChatsViewController: HomeViewController {

override func addMatrixSession(_ mxSession: MXSession!) {
super.addMatrixSession(mxSession)
initDataSource()

if let dataSource = dataSource, !dataSource.mxSessions.contains(where: { $0 as? MXSession == mxSession }) {
dataSource.addMatrixSession(mxSession)
// Setting the delegate is required to send a RecentsViewControllerDataReadyNotification.
// Without this, when clearing the cache we end up with an infinite green spinner.
(dataSource as? RecentsDataSource)?.setDelegate(self, andRecentsDataSourceMode: recentsDataSourceMode)
} else {
initDataSource()
}
}

override func removeMatrixSession(_ mxSession: MXSession!) {
super.removeMatrixSession(mxSession)

guard let dataSource = dataSource else { return }
dataSource.removeMatrixSession(mxSession)
}

private func initDataSource() {
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6709.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New App Layout: Make sure the green loading spinner is dismissed after clearing the cache.

0 comments on commit 6f92a65

Please sign in to comment.