Twitch TV issues

Twitch TV issues
0

#1

Hello,

I am having some issues completing the Twitch TV challenge. I am using the https://wind-bow.gomix.me/twitch-api/ URL that was suggested. I make 2 separate calls for each entry given. The first to streams/ and the second to channels.

Streams/ tells me whose online, then channels/ gives me the rest of the data I need. Everything works fine except the online/offline part.

I have an if/else statement that assigns a string that says either “currently online” or “currently offline”.
when I console.log the data from my streams/ call, I receive exactly the data I’d expect, but for some reason my if/else block seems to only work sometimes.

Does anything jump out to anyone other than the ugly css? Here is a link to the codepen:

Code pen

thanks in advance,
Cullen


#2

I’ve tested it a few times and also looked into the code and it doesn’t look like you have an issue and I don’t seem to be able to spot anything wrong with it, have you fixed the issue already? Otherwise, could you elaborate on what you mean by “if/else block seems to only work sometimes”?

The only other thing that I could think of is perhaps an issue with the nested jQuery.getJSON()s, but I don’t know enough to say what’s wrong (it’s just a hunch, and if something is indeed wrong) and I think potential issues with variable scoping is probably also not an issue here since you are using let, hopefully someone can comment on this if it is indeed the problem.


#3

I was thinking it might be the nested getter too, but I also wouldnt know why that would mess things us. It wasnt assigning the correct online/offline value. Now it magically started working and I have no idea why.