Help forum

  • vilosia.florian-1279395664832237691

    Flo@Vilosia

    9

    5 months ago

    Record Audio / Video
    The AI sent me over so I give it a try in here 🙂

    Is it possible to access the browser built-in getUserMedia api to record audio / video from within toddle? I've seen the custom-actions
    https://toddle.dev/docs/custom-actions
    documentation but I'm not sure if this is the right path to go, or if there are any higher level concepts that provide this functionality?

    best Flo
  • tomthebigtree-1278700338135961663

    Tom Ireland

    41

    5 months ago

    Can't read locally uploaded file in custom action
    Over lunch, I'm trying to get my app to read a locally uploaded file to display a preview prior to upload to the server, so I understand I need to use the FileReader API via a custom action.

    I can get event.target.files[0] via onchange event on my input (type is file and accepts jpg and png) and store that into a variable but when passing it as an argument in my custom action, I'm getting the following error:

    Error in Custom Action TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'.

    I don't see where I'm going wrong because if I log my variable to console before I pass it to my custom action, I can see the files data.

    Here is the custom action:

    function fileReader(file) {
    const reader = new FileReader();
    reader.readAsDataURL(file);
    }


    Any pointers? Let me know if you want the branch (and component URL) for a wee peek.
  • plusmin-1278600541441622068

    Armand

    1
    3

    5 months ago

    My app is laggy when I'm logged in
    My app uses Supabase for auth and database. And the moment I log into it on the frontend it just becomes laggy, particularly on the input fields.
    When not logged in, it behaves normally.

    I am not loading a lot of data, 1 row from Table A and about 50ish rows from Table B, no images in either table's column and less than 50kb in total. As far as I can tell from the Network tab in the inspector, there are no unnecessary calls to the API. I only see them pop-up when they should, so I don't think I inadvertently created some call API loop.

    The above behavior (laggy when logged in, normal when not logged in) is the same across different devices and browsers:
    1. MacOS (Safari/Firefox)
    2. iOS (Safari)

    The fact that it occurs when logged in indicates that it has something to do with Supabase or how I've its API set up, but I can't find it.

    Does anyone have any idea of where I should look to find the cause?
  • tcg.store-1277444426934784042

    TCG.Store

    42

    5 months ago

    Large Number of Items - API
    Hi team,

    Any way for me to fetch a specific number of results and lazy load the rest as a user scrolls? or should i upgrade my plan ?

    The API returns over 22,000+ products for a tool i'm building.

    I upgrade to scale up plan, but still having issues.
  • chrislaupama-1275746485555957821

    Chris Laupama

    6

    5 months ago

    How are you gating pages?
    Let's say I have a login, signup and home page.

    I want the home page to be gated ( require a logged in user to see it )

    Are you creating an "On load" lifecycle event? ( if so, how are you doing this? I keep getting stuck on a switch statement )

    Or are you making an API call and having the success do nothing, or maybe just store something and have the error flow use the "Go to URL" action?

    Thinking of the best way to do it, but interestingly I just can't get my head around getting the "On load" even working as I'm checking the session cookie and that doesn't seem to be working...
  • shihanms-1275522955958292561

    shihanms

    👍1
    5

    5 months ago

    Xano Session Logout
    I'm using xano authentication and store the session cookie when logging in. After setting cookie redirect to the dashboard. In dashboard I have a button for logout . When clicking it I need to clear the session cookie and hence redirect back to the login screen.
  • nix.nz-1275001570118860841

    Marko

    11

    5 months ago

    Login component export
    Hi there! I’ve created a component for logging users in using a standard email and password form, with Supabase as my backend auth. It works great in toddle, but when I export the component script and place it on my Webflow website, it doesn’t seem to work; error messages from the console below.

    I’m aiming to create my own solution instead of using Memberstack or Outseta so I can have more freedom in how users log in and interact with their profile data. All the authenticated components will be made in toddle. The website is already built in Webflow, and the client is keen to stay with it.
  • patrickmast-1274428577865138288

    Patrick Mast

    3

    5 months ago

    Username via slug?
    I have a sample app: https://slug_user.toddle.site/
    It features a variable "slug" that is concatenated within the H1 string to display "Welcome User".
    My goal is to use the slug as the username.
    For example:
    - https://slug_user.toddle.site/Andreas should show "Welcome Andreas"
    - https://slug_user.toddle.site/Kasper should show "Welcome Kasper"
    How can I do this?
  • chromonav-1269244301729075272

    chromonav

    3

    6 months ago

    reading cookie value from API response and setting cookie in toddle.
    use-case brief:

    calling api /api/method/login with username and password.
    i recieve 201 response with empty body but cookie is set.

    Because of CORS restrictions i need to use toddle to proxy.

    How can i read the cookie and set it in the toddle site.
  • lucifer811-1266461086035611773

    Lucifer

    🤔2
    👍1
    12

    6 months ago

    Has anyone been successful in making a date range picker similar to Airbnb's?
    I'm trying to do this with the vanilla calendar package and using 2 date entry fields but unsure if this is the right approach. How would you all build this? I have an API connected to Xano that can accept 2 dates (start & end).
  • roccons-1266105572126888046

    roccons

    14

    6 months ago

    Not being able to use Bearer access_token after login with Supabase
    I already have a succesuful login and I'm getting my Bearer access_token within the response data, but I'm not being suceessful at saving it as a Session cookie so when I try to use it in another API request using Bearer access_token for Authentication I get a 401 error with the message "This endpoint requires a Bearer token". What I am missing?
    I attach some images of the configuration of my two API requests.
  • this.rhymes-1265195142894063667

    rhymes

    11

    6 months ago

    Authorization header not being sent with API request to Xano
    Following the todo tutorial (thank you for the resources!), but am having issues with authenticating requests to Xano. Upon investigating the requests received by Xano, it appears that the Authorization header is missing.

    I tried the same request with Postman (getting the token from my cookie) and it worked.

    The Authorization in the Toddl API window is set to Bearer <access_token and Proxy has been checked.

    Am I missing a setting somewhere to get my project to send the Authorization header?

    PS Unsure if it's important, but I received a "error code: 521" in the Toddl window a couple of times - but those requests never hit Xano.

    Much thanks!
  • jaxwedel-1263457295900348496

    Jax Wedel

    13

    6 months ago

    Changing default styles
    I am working on how styling can be done efficiently in Toddle, and I am trying to find out how to do a stylesheet for all elements. I want to avoid having to change every component every time, because that will cause issues and mistakes. But it seems Toddle doesnt support stylesheets, and the advice seems to be to create every element as components, and then style all of those components every time, and then insert them into the app instead of using the basic toddle elements. Which seems a bit strange since you are basically building a stylesheet one by one as components.

    Is this correct? Is there no other way to do a stylesheet?

    And regarding light/dark mode, I watched the video called "Lights on" https://www.youtube.com/watch?v=_HKZGI6UW_g
    @Andreas Møller mentions there that there is an easier way to do this in larger apps, is that video out? Because I would rather do two separate stylesheets than to build in this logic in every component.

    PS: I see a solution by creating a global variable like "light" and "dark". But not sure where you do that in Toddle (on root page/homepage?).
  • jaxwedel-1262849554022400020

    Jax Wedel

    77

    6 months ago

    Conditional rendering based on the viewport size
    How do I set an element to not render when the viewport is below 600px? I have been looking everywhere for this solution.
  • fantastic_seahorse_35860_63547-1259669930178121860

    Dan

    7

    7 months ago

    How do I handle optional query parameter?
    I have a button that populates a query parameter only on click. I have a variable with default value null that gets specific value "A" when the button is clicked which will be used as a query parameter in the API request.

    How do I make this query parameter optional so that when the button is not clicked this parameter is omitted in the request URL?

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.