6060 }
6161 }
6262
63- private async Task Search ()
63+ private async Task Search (bool showToast = true )
6464 {
6565 _isSearching = true ;
6666
6767 _searchResult = await UserSearchService .GetUsersAsync (_filter );
6868
69- Snackbar .Clear ();
70-
71- if (_searchResult .TotalCount is 0 )
69+ if (showToast )
7270 {
73- Snackbar .Add (
74- message : " Ingen brugere matchede søgningen." ,
75- severity : Severity .Info ,
76- options =>
71+ Snackbar .Clear ();
72+
73+ if (_searchResult .TotalCount is 0 )
7774 {
78- options .VisibleStateDuration = 3500 ;
79- options .CloseAfterNavigation = true ;
80- });
81- }
82- else
83- {
84- Snackbar .Add (message : $" {_searchResult .TotalCount } brugere matchede søgningen." ,
85- severity : Severity .Success ,
86- options =>
75+ Snackbar .Add (
76+ message : " Ingen brugere matchede søgningen." ,
77+ severity : Severity .Info ,
78+ options =>
79+ {
80+ options .VisibleStateDuration = 3500 ;
81+ options .CloseAfterNavigation = true ;
82+ });
83+ }
84+ else
8785 {
88- options .VisibleStateDuration = 3500 ;
89- options .Icon = Icons .Material .Filled .ArrowDownward ;
90- options .CloseAfterNavigation = true ;
91- });
86+ Snackbar .Add (message : $" {_searchResult .TotalCount } brugere matchede søgningen." ,
87+ severity : Severity .Success ,
88+ options =>
89+ {
90+ options .VisibleStateDuration = 3500 ;
91+ options .Icon = Icons .Material .Filled .ArrowDownward ;
92+ options .CloseAfterNavigation = true ;
93+ });
94+ }
9295 }
9396
9497 _hasSearched = true ;
102105 private async Task OnSelectedPageChanged (int selectedPage )
103106 {
104107 _filter .PageNumber = selectedPage ;
105- await Search ();
108+ await Search (showToast : false );
106109 }
107110}
0 commit comments