• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Compliments not displaying

Scheduled Pinned Locked Moved Solved Development
17 Posts 5 Posters 10.8k Views 5 Watching
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.
  • L Offline
    l1613532 @l1613532
    last edited by Mar 10, 2017, 6:28 PM

    and we are both running jesse lite

    S 1 Reply Last reply Mar 10, 2017, 6:31 PM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @l1613532
      last edited by Mar 10, 2017, 6:31 PM

      @l1613532 in the start method of the compliments.js file is an es6 arrow function which isn’t supported by the midori browser. But that doesn’t explain your error from the logs

      Please create a github issue if you need help, so I can keep track

      L 1 Reply Last reply Mar 10, 2017, 6:55 PM Reply Quote 0
      • L Offline
        l1613532 @strawberry 3.141
        last edited by Mar 10, 2017, 6:55 PM

        @strawberry-3.141 said in Compliments not displaying:

        es6 arrow function

        Can you describe this es6 arrow function at the start of compliments.js and what I can manually replace it with that will be supported by Midori?

        1 Reply Last reply Reply Quote 0
        • L Offline
          l1613532
          last edited by Mar 12, 2017, 5:47 AM

          Found the answer! Thank you to @strawberry-3-141 for pointing me in the right direction.

          in the compliments.js file (found in /MagicMirror/modules/default/compliments folder), change:

          	if (this.config.remoteFile != null) {
          		this.complimentFile((response) => {
          			this.config.compliments = JSON.parse(response);
          		});
          	}
          

          to:

                   if (this.config.remoteFile != null) {
                          this.complimentFile(
                                  function(response){
                                          this.config.compliments = JSON.parse(response);
                          });
                  }
          

          For all those using Midori browser (which appears to be the only browser which runs MM2 on Pi Zero), this will be an ongoing problem for certain modules that use es6 arrow functions. See https://github.com/MichMich/MagicMirror/issues/694 for more info.

          S 1 Reply Last reply Mar 12, 2017, 8:21 AM Reply Quote 0
          • S Offline
            strawberry 3.141 Project Sponsor Module Developer @l1613532
            last edited by Mar 12, 2017, 8:21 AM

            @l1613532 this code isn’t working properly, you have to do

            if (this.config.remoteFile != null) {
              var self = this;
              this.complimentFile(
                function(response){
                  self.config.compliments = JSON.parse(response);
                 });
            }
            

            Please create a github issue if you need help, so I can keep track

            J 1 Reply Last reply Apr 1, 2017, 1:51 PM Reply Quote 2
            • J Offline
              jin
              last edited by Mar 13, 2017, 10:05 PM

              Seeing the solution after a couple of long shifts is a nice surprise.
              Great work l1613532 and strawberry 3.141.

              1 Reply Last reply Reply Quote 0
              • J Offline
                jacobmar1ey @strawberry 3.141
                last edited by Apr 1, 2017, 1:51 PM

                @strawberry-3.141 said in Compliments not displaying:

                @l1613532 this code isn’t working properly, you have to do

                if (this.config.remoteFile != null) {
                  var self = this;
                  this.complimentFile(
                    function(response){
                      self.config.compliments = JSON.parse(response);
                     });
                }
                

                Tank you so much for this response. My Zero (non-W) was also suddenly not displaying compliments as well and I was trying to figure it out all week!

                1 Reply Last reply Reply Quote 0
                • 1
                • 2
                • 2 / 2
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy