File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ class CustomComponentGalleryState(rx.State):
3434 # Added available limits for the number of items per page
3535 limits : list [str ] = ["10" , "20" , "50" , "100" ]
3636
37- @rx .event
38- def fetch_components_list (self ):
37+ @rx .event ( background = True )
38+ async def fetch_components_list (self ):
3939 try :
4040 response = httpx .get (
4141 f"{ os .getenv ('RCC_ENDPOINT' )} /custom-components/gallery"
@@ -55,12 +55,13 @@ def fetch_components_list(self):
5555 ]
5656 c ["download_url" ] = package_url (c ["package_name" ])
5757
58- self .original_components_list = component_list
59- self .number_of_rows = len (component_list )
60- self .total_pages = (
61- self .number_of_rows + self .current_limit - 1
62- ) // self .current_limit
63- self .paginate ()
58+ async with self :
59+ self .original_components_list = component_list
60+ self .number_of_rows = len (component_list )
61+ self .total_pages = (
62+ self .number_of_rows + self .current_limit - 1
63+ ) // self .current_limit
64+ self .paginate ()
6465
6566 @rx .event
6667 def paginate (self ) -> None :
You can’t perform that action at this time.
0 commit comments