No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Build: _this is not a function

    Help
    1
    1
    490
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      silentcoast last edited by

      Having a tough time tracking this one down but maybe y’all have seen something like it. The code looks fine and works great on dev so not sure what I’m missing… This is being built with 0.15.3, running with quasar dev it works perfect.

      Error I’m getting is: _this.userTheme is not a function

      Here’s what the function looks like:

      export const userTheme = (state) => {
        var pi = _.findIndex(state.user.properties, function (o) {
          return o.type === 'theme'
        })
        if (pi > -1) {
          return _.toInteger(state.user.properties[pi].value)
        } else {
          let ct = this.customerTheme(state)
          if (ct === -1) {
            return 0
          } else {
            return ct
          }
        }
      }
      
      export const whichThemeNamed = (state) => {
        let which = this.userTheme(state) <-------Errors out here
        which = (which === 0) ? 'lighttheme' : 'darktheme'
        t.$log('Which Theme Named', {
          theme: which
        })
        return which
      }
      1 Reply Last reply Reply Quote 0
      • First post
        Last post