changed callback to be async

This commit is contained in:
2025-09-27 08:26:37 +02:00
parent 8034c9ec11
commit 20c95a384e
2 changed files with 11 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ async def main_page():
# Example 1: Multiple files with content
uploaded_files = ui.column().classes('w-full mt-4')
def handle_multiple_files(file: FileData):
async def handle_multiple_files(file: FileData):
with uploaded_files:
with ui.card().classes('p-2 mb-2'):
ui.label(f"📄 {file['name']}").classes('font-medium')
@@ -26,7 +26,7 @@ async def main_page():
on_upload=handle_multiple_files,
multiple=True,
accept='.pdf,.docx,.txt,.jpg,.png',
max_size=5 # 5MB limit
max_size=15 # 5MB limit
).classes('w-full max-w-xl mx-auto')
ui.separator().classes('my-8')
@@ -72,7 +72,7 @@ async def main_page():
# Example 4: Image drop with preview
image_preview = ui.column().classes('w-full mt-4')
def handle_image(img: ImageData):
async def handle_image(img: ImageData):
print(f"Image uploaded: {img['image'].format}, Size: {img['size']}")
image_preview.clear()
with image_preview: