Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Toast does not works when session is typed #635

Open
4 tasks done
barenko opened this issue Jan 12, 2025 · 0 comments
Open
4 tasks done

[BUG] Toast does not works when session is typed #635

barenko opened this issue Jan 12, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@barenko
Copy link

barenko commented Jan 12, 2025

The toast does not shows if you use typing in your session parameter.

Look the code:

app,rt = fast_app()

setup_toasts(app)

@rt('/test-toast1')
def get(session): 
    add_toast(session, f"This is a test toast", "info")
    return Main(Div(f"I like toast, the session type is: {type(session)}"))

@rt('/test-toast2')
def get(session:dict): 
    add_toast(session, f"This is a test toast", "info")
    return Main(Div(f"I like toast, the session type is: {type(session)}"))

When I call /test-toast1, the toast shows and the msg says that session type is dict
When I call /test-toast2, the toast DOES NOT shows and the msg says that session type is dict

Expected behavior
The toast should work independently of the typing mark.

Environment Information

  • fastlite version: 0.1.1
  • fastcore version: 1.7.28
  • fasthtml version: 0.10.3

Confirmation
Please confirm the following:

  • I have read the FAQ (https://docs.fastht.ml/explains/faq.html)
  • I have provided a minimal reproducible example
  • I have included the versions of fastlite, fastcore, and fasthtml
  • I understand that this is a volunteer open source project with no commercial support.
@barenko barenko added the bug Something isn't working label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant