Skip to content

Fix last world clock is a function #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix last world clock is a function #28

wants to merge 1 commit into from

Conversation

couraudt
Copy link

Hi there,

FIrst of all thanks for your cinnamon applets, it's very useful for me!

Since last Cinnamon update (3.2.x), your applet didn't work any more. I had this issue:

error t=2016-11-10T16:53:23.569Z this.worldclocks[i].split is not a function
trace t=2016-11-10T16:53:23.569Z 
<----------------
MyApplet.prototype._init/addWorldClocks<@/home/user/.local/share/cinnamon/applets/[email protected]/applet.js:109

After looking at the code, I found that there's an element added at the end of the wordclocks array and that element is a function. I don't know where it come from, neither what changed in the Cinnamon applet configuration variables.

Anyway, this patch fix the issue and make the clock works again. but may be there's maybe something more to change in the code.

@simonwiles
Copy link
Owner

Thanks for this -- I'll take a look as soon as I can!

@jethrogb
Copy link

Same issue here, can confirm this seems to fix it

@sphh
Copy link

sphh commented Jan 6, 2017

I had the same issues as #30 and #31 on Linux Mint 18.1. I can confirm that this patch solves both.

@nicoma in #31 publishes a applet.js with a lot of changes. He tackles this problem with the following code. Maybe it's worth considering this approach:

            for (i in this.worldclocks) {
                try {
                    this._worldclocks[i] = this.worldclocks[i].split("|");
                }
                catch(e) {
                   // global.logError("error to fix : " + e); //TODO
                }
             }

@nicoma
Copy link

nicoma commented Jan 6, 2017

Yes, a cleaner way is to refork the initial project and add the world clock features (as I tried to do).
Concerning the "split is not a function" . a try catch is not really clean..
The solution of @sweetdub is valid until there is no solution to have only a list of String elements.
For me, the initial list "this.worldclocks" should only contains String elements with a pipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants