Skip to content
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

Can't have ImageIndexOff without ImageIndexOn #13

Closed
RicksterGit opened this issue May 3, 2018 · 2 comments
Closed

Can't have ImageIndexOff without ImageIndexOn #13

RicksterGit opened this issue May 3, 2018 · 2 comments

Comments

@RicksterGit
Copy link

WatchfaceEditor.js

If you have an "Off" image without an "On" image you get an "Can't find image undefined" error.

Alarm, DND and Lock need to check for image first before trying to use, like BT does.

else if ('ImageIndexOn' in wfe.coords.statbt && wfe.data.bluetooth)

status: {
alarm: function () {
if ('ImageIndexOff' in wfe.coords.statalarm && !wfe.data.alarm)
t = $c(wfe.coords.statalarm.ImageIndexOff);
else if (wfe.data.alarm)
t = $c(wfe.coords.statalarm.ImageIndexOn);
else return;
t.style.left = wfe.coords.statalarm.Coordinates.X + "px";
t.style.top = wfe.coords.statalarm.Coordinates.Y + "px";
wfe.view.insert(t, "c_stat_alarm");
},
bt: function () {
if ('ImageIndexOff' in wfe.coords.statbt && !wfe.data.bluetooth)
t = $c(wfe.coords.statbt.ImageIndexOff);
else if ('ImageIndexOn' in wfe.coords.statbt && wfe.data.bluetooth)
t = $c(wfe.coords.statbt.ImageIndexOn);
else return;
t.style.left = wfe.coords.statbt.Coordinates.X + "px";
t.style.top = wfe.coords.statbt.Coordinates.Y + "px";
wfe.view.insert(t, "c_stat_bt");
},
dnd: function () {
if ('ImageIndexOff' in wfe.coords.statdnd && !wfe.data.dnd)
t = $c(wfe.coords.statdnd.ImageIndexOff);
else if (wfe.data.dnd)
t = $c(wfe.coords.statdnd.ImageIndexOn);
else return;
t.style.left = wfe.coords.statdnd.Coordinates.X + "px";
t.style.top = wfe.coords.statdnd.Coordinates.Y + "px";
wfe.view.insert(t, "c_stat_dnd");
},
lock: function () {
if ('ImageIndexOff' in wfe.coords.statlock && !wfe.data.lock)
t = $c(wfe.coords.statlock.ImageIndexOff);
else if (wfe.data.lock)
t = $c(wfe.coords.statlock.ImageIndexOn);
else return;
t.style.left = wfe.coords.statlock.Coordinates.X + "px";
t.style.top = wfe.coords.statlock.Coordinates.Y + "px";
wfe.view.insert(t, "c_stat_lock");
}
},

v1ack added a commit that referenced this issue May 3, 2018
@v1ack
Copy link
Owner

v1ack commented May 3, 2018

Thanks, fixed

@v1ack v1ack closed this as completed May 3, 2018
@RicksterGit
Copy link
Author

RicksterGit commented May 9, 2018

Thanks for the fix.

I don't see how to re-open this Issue...

I just noticed that if I select RESOURCES such a JSON, the list stops at the entry beforehand and then prints "Status bluetoothImageIndex: 69, undefined" (the next entry has an OFF image, but no ON image)

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

No branches or pull requests

2 participants