diff --git a/src/backend/effects/builtin/twitch/stream-game.ts b/src/backend/effects/builtin/twitch/stream-game.ts index 4d3027056..ff96a57c3 100644 --- a/src/backend/effects/builtin/twitch/stream-game.ts +++ b/src/backend/effects/builtin/twitch/stream-game.ts @@ -5,7 +5,7 @@ import twitchApi from "../../../twitch-api/api"; import eventsManager from "../../../events/EventManager"; const model: EffectType<{ - mode: "specific" | "custom"; + mode: "specific" | "custom" | "clear"; gameId: string; gameName: string; }> = { @@ -30,6 +30,10 @@ const model: EffectType<{
+ @@ -97,11 +101,16 @@ const model: EffectType<{ await twitchApi.channels.updateChannelInformation({ gameId: event.effect.gameId }); - } else { - const categories = await twitchApi.categories.searchCategories(event.effect.gameName.trim()); + } else if (event.effect.mode === "clear" || event.effect.mode === "custom" && !event.effect.gameName) { + //user left the gamename blank + await twitchApi.channels.updateChannelInformation({ + gameId: '' + }); + } else if (event.effect.mode === "custom") { + const categories = await twitchApi.categories.searchCategories(event.effect.gameName?.trim()); if (categories?.length) { const category = - categories.find((c) => c.name.toLowerCase() === event.effect.gameName.toLowerCase()) ?? + categories.find(c => c.name.toLowerCase() === event.effect.gameName.toLowerCase()) ?? categories[0]; if (!category) { diff --git a/src/gui/app/directives/modals/misc/edit-stream-info-modal.js b/src/gui/app/directives/modals/misc/edit-stream-info-modal.js index 7ea813adc..885072288 100644 --- a/src/gui/app/directives/modals/misc/edit-stream-info-modal.js +++ b/src/gui/app/directives/modals/misc/edit-stream-info-modal.js @@ -34,20 +34,31 @@