Read the statement by Michael Teeuw here.
Compliments not displaying
-
@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?
-
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.
-
@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); }); }
-
Seeing the solution after a couple of long shifts is a nice surprise.
Great work l1613532 and strawberry 3.141. -
@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!