Pricing Blog

Help with custom formula

  • andreasmoller-1164948804601131009

    Andreas Møller

    2 years ago

    No is the key “item” right?
  • And did you json encode it when you saved it?
  • lucasg-1164949558900572201

    Lucas G

    2 years ago

    I tried with and without the JSON parse but it was null either way. I stored it like so:
    localStorage.setItem('theme', 'dark-mode');
  • I see it in the console so not sure where I messed up
  • andreasmoller-1164953389940080752

    Andreas Møller

    2 years ago

    Then you need to fetch it with localStorage.getItem(“theme)
  • And no json parse
  • andreasmoller-1164954014128029786

    Andreas Møller

    2 years ago

    It is possible to do theme switching, but it is going to be messy.
  • I would recommend waiting till we roll out support for it
  • Unless it is absolutely critical
  • lucasg-1164955160225779733

    Lucas G

    2 years ago

    That is how it’s being fetched
  • Not critical though, was just playing around with custom actions and formulas for now.
  • This is how I implemented it on another project (not toddle) so wanted to recreate it
  • Other was via vanilla JS though of course
  • I’ll give it another try and see
  • lucasg-1164962051161067592

    Lucas G

    2 years ago

    re-wrote it and got it working