Skip to content

Commit acc6626

Browse files
pixlwavepoljar
authored andcommitted
fix: Don't show a syncing indicator until the sync service is started.
1 parent e6094e6 commit acc6626

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

crates/matrix-sdk-ui/src/room_list_service/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,11 @@ impl RoomListService {
386386

387387
loop {
388388
let (sync_indicator, yield_delay) = match current_state {
389-
State::Init | State::SettingUp | State::Error { .. } => {
389+
State::SettingUp | State::Error { .. } => {
390390
(SyncIndicator::Show, delay_before_showing)
391391
}
392392

393-
State::Recovering | State::Running | State::Terminated { .. } => {
393+
State::Init | State::Recovering | State::Running | State::Terminated { .. } => {
394394
(SyncIndicator::Hide, delay_before_hiding)
395395
}
396396
};

crates/matrix-sdk-ui/tests/integration/room_list_service.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,10 +2714,11 @@ async fn test_sync_indicator() -> Result<(), Error> {
27142714

27152715
// Request 1.
27162716
{
2717-
// The state transitions into `Init`. The `SyncIndicator` must be `Show`.
2717+
// The state transitions into `Init`. The `SyncIndicator` stays in `Hide` as
2718+
// nothing is happening yet.
27182719
assert_next_sync_indicator!(
27192720
sync_indicator,
2720-
SyncIndicator::Show,
2721+
SyncIndicator::Hide,
27212722
under DELAY_BEFORE_SHOWING + request_margin,
27222723
);
27232724
}
@@ -2726,7 +2727,8 @@ async fn test_sync_indicator() -> Result<(), Error> {
27262727

27272728
// Request 2.
27282729
{
2729-
// The state transitions into `SettingUp`. The `SyncIndicator` stays in `Show`.
2730+
// The state transitions into `SettingUp`. The `SyncIndicator` must be `Show` as
2731+
// the service has now been started.
27302732
assert_next_sync_indicator!(
27312733
sync_indicator,
27322734
SyncIndicator::Show,

0 commit comments

Comments
 (0)