Read the statement by Michael Teeuw here.
How can I add more time periods for MMM-compliments?
-
@lavolp3 said in How can I add more time periods for MMM-compliments?:
owever, you would need to change the logic to a switch function, because there can only be one “else if” in an “if” statement.
not true, you can have as many as u want…
switch sometimes makes things more clear, but not always
-
This is actually my first time programming ever, so I don’t actually know what are logic or switch functions.
This is what I attempted, but it didn’t work, and instead the compliments module just didn’t load up when starting MM:
![I added two more time period: predawn and night](https://imgur.com/a/JJrJ01w) ![Updated the time intervals](https://imgur.com/a/lzAO0gJ) ![And tried modifying the compliments array as well](https://imgur.com/a/ZiNT8u5)
-
@dæmoneyes your changes didn’t show
use the three back-tics before and after your code
on keyboard, left of the number 1 key -
@sdetweil Here are all the changes I tried: https://imgur.com/a/wbYQclq
-
@dæmoneyes start the mirror with
npm start dev
and in the white developers window, select the console tab,
scroll up/down to find any errors (red text)…I can’t see all your code, but its probably a missing quote, paren or brace
-
@sdetweil Did that, found some red related to compliments and also to openweather
Here is the full console tab: https://imgur.com/a/Lrn8kVH -
@dæmoneyes compliments.js:48 syntax error
that means on line 48 of the complements.js file the compiler found an error…
-
@sdetweil Once again, I owe you my thanks sdetweil! It works now!
What should I do about the red related to the openweathermap?
-
@dæmoneyes openweathermap… I do not know… sorry…
-
@sdetweil hey no problem, it seems to be working fine, so I guess I shouldn’t worry about it.
If I may ask one more question, should I do anything about the yellow warning ‘Electron Security Warning’?