diff --git a/twitch/customOverlay.js b/twitch/customOverlay.js index 52d239b..84a7adc 100644 --- a/twitch/customOverlay.js +++ b/twitch/customOverlay.js @@ -47,17 +47,4 @@ $.registerChatSubcommand('overlay', 'timer', 2); }); - $(document).ready(async ()=>{ - if(socket){ - while(socket.getReadyState() === 0){ - await new Promise(r => setTimeout(r, 500)); - } - socket.getDBValue("get_current_stream_info", 'streamInfo', 'lastSub', function(response) { - console.log(response); - - if(response.request_data) console.log(response.request_data) - }) - } - }) - })(); \ No newline at end of file diff --git a/web/overlay/index.js b/web/overlay/index.js index 1c71aa0..b3dd1a6 100644 --- a/web/overlay/index.js +++ b/web/overlay/index.js @@ -45,4 +45,17 @@ $(function () { socket.addFamilyHandler("overlay", handleSocketMessage); + $(document).ready(async ()=>{ + if(socket){ + while(socket.getReadyState() === 0){ + await new Promise(r => setTimeout(r, 500)); + } + socket.getDBValue("get_current_stream_info", 'streamInfo', 'lastSub', function(response) { + console.log(response); + + if(response.request_data) console.log(response.request_data) + }) + } + }) + }); \ No newline at end of file