Skip to content

Commit 73447e5

Browse files
authored
Merge branch 'v1.0-dev' into fix/auto-load-profile-on-wallet-import
2 parents f4f72c4 + 8e4bd9d commit 73447e5

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

src/ui/dashpay/profile_search.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::app::{AppAction, DesiredAppAction};
22
use crate::backend_task::dashpay::DashPayTask;
3+
use crate::backend_task::error::TaskError;
34
use crate::backend_task::{BackendTask, BackendTaskSuccessResult};
45
use crate::context::AppContext;
56
use crate::ui::components::dashpay_subscreen_chooser_panel::add_dashpay_subscreen_chooser_panel;
@@ -251,8 +252,9 @@ impl ProfileSearchScreen {
251252
}
252253

253254
pub fn display_message(&mut self, _message: &str, _message_type: MessageType) {
254-
// Banner display is handled globally by AppState; this is only for side-effects.
255-
self.loading = false;
255+
// Don't touch loading state here — display_message can be called for
256+
// unrelated task completions while we're waiting for search results.
257+
// Loading state is managed by search_profiles() and display_task_result().
256258
}
257259
}
258260

@@ -318,10 +320,9 @@ impl ScreenLike for ProfileSearchScreen {
318320
}
319321

320322
fn display_task_result(&mut self, result: BackendTaskSuccessResult) {
321-
self.loading = false;
322-
323323
match result {
324324
BackendTaskSuccessResult::DashPayProfileSearchResults(results) => {
325+
self.loading = false;
325326
self.search_results.clear();
326327

327328
// Convert backend results to UI results
@@ -366,8 +367,16 @@ impl ScreenLike for ProfileSearchScreen {
366367
// Message display is handled globally by AppState
367368
}
368369
_ => {
369-
// Ignore other results
370+
// Ignore other results — don't touch loading state for
371+
// results from unrelated tasks
370372
}
371373
}
372374
}
375+
376+
fn display_task_error(&mut self, _error: &TaskError) -> bool {
377+
// Clear loading state on error so the spinner stops.
378+
// Return false to let AppState show the default error banner.
379+
self.loading = false;
380+
false
381+
}
373382
}

0 commit comments

Comments
 (0)