Fix Kick game persistence. - #6139
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes Kick category (“game”) persistence by ensuring GameSelector writes Kick selections back into KickService state (ID + name), and by exposing Kick’s game/gameName through the shared StreamInfoView getters used across windows.
Changes:
- Add Kick
gameNameto stream settings/options, seed it in initial state, and mirror it intosettingsviaSET_GAME_NAMEfor persistence. - Add
KickService.setGameInfo({ gameId, gameName })and call it fromGameSelectorwhen the active platform is Kick. - Extend
StreamInfoView.game/.gameNameto resolve Kick values; adjust KicksearchGamesquery building and add afetchGameempty-name guard.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
app/services/platforms/kick.ts |
Persist Kick gameName alongside game, add setGameInfo, and adjust game search/fetch behavior. |
app/components-react/windows/go-live/GameSelector.tsx |
Write Kick game selection back into KickService so UI/service stay in sync. |
app/services/streaming/streaming-view.ts |
Allow common game / gameName getters to return Kick values when Kick is enabled. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| async searchGames(searchString: string): Promise<IGame[]> { | ||
| const host = this.hostsService.streamlabs; | ||
| const url = `https://${host}/api/v5/slobs/kick/info?category=${searchString}`; | ||
| const params = new URLSearchParams({ category: searchString }); | ||
| const url = `https://${host}/api/v5/slobs/kick/info?${params.toString()}`; | ||
| const headers = authorizedHeaders(this.userService.apiToken); | ||
| const request = new Request(url, { headers }); | ||
|
|
BundleMonFiles updated (1)
Unchanged files (3)
Total files change +6.33KB +0.04% Final result: ✅ View report in BundleMon website ➡️ |
gettinToasty
left a comment
There was a problem hiding this comment.
i agree with copilot that the guard clause should be before the http request but otherwise looks good
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
app/services/platforms/kick.ts:480
setGameInfowritesgameNameinto settings viaUPDATE_STREAM_SETTINGS, then immediately callsSET_GAME_NAME, which now also mirrorsgameNameintostate.settings. This double-writes the same field; consider lettingSET_GAME_NAMEbe the single place that mirrors the name into settings and only updating the id viaUPDATE_STREAM_SETTINGS.
setGameInfo({ gameId, gameName }: { gameId: string; gameName: string }) {
this.UPDATE_STREAM_SETTINGS({ game: gameId, gameName });
this.SET_GAME_NAME(gameName);
}
This reverts commit 9f256d6.
* Revert "Fix padding on live output editing toggles. (#6143)" This reverts commit a202ab6. * Revert "Multistream Toggle Fixes and Error Handling (#6141)" This reverts commit 2ec1daf. * Revert "Disable enhanced broadcasting when live output editing is enabled. (#6121)" This reverts commit bfd48b5. * Revert "Add live output editing display selector handling. (#6120)" This reverts commit f59c58a. * Revert "Add dismissable to AI Highlighter toggle in Edit Stream window. (#6128)" This reverts commit 5fa1b1b. * Revert "Edit stream window. (#6119)" This reverts commit eab5de9. * Revert "Update go live checklist. (#6118)" This reverts commit 4549e56. * Revert "Fix Kick game persistence. (#6139)" This reverts commit 9f256d6. * Revert "Add go live info banner. (#6116)" This reverts commit 75336b0. * Revert "Move SwitcherCard tooltip hover to toggle. (#6115)" This reverts commit 056d5da. * Revert "Fix tooltip wrapping. (#6114)" This reverts commit 153aa3f. * Revert "Add button to footer. (#6113)" This reverts commit 9f3cd65. * Revert "Add disabled radio button styling. (#6112)" This reverts commit 877db2a. * Revert "Fix onboarding test (#6132)" This reverts commit e439f6f. * Revert "Add small and inline Spinner variants. (#6111)" This reverts commit ae6c143.
Persist the Selected Kick Category Across the Go Live and Edit Stream Windows
Issues
Selecting a Kick category did not persist. The field reverted to the previous category, or rendered a bare numeric id, and the choice was invisible to everything downstream of the form.
The selection never reached service state.
GameSelectorrenders its value from the service but sends changes to the form, and nothing joined the two for Kick.KickEditStreamInfo.tsx:37binds the selector with{...bind.game}, supplying bothvalueandonChange, butGameSelectornever readsp.value— it computes its own fromplatformService.state.settings.game(line 27) andServices.KickService.state.gameName(line 43), then renders<ListInput value={selectedGameId}>.onSelectwrote back to the service for TikTok and Twitch (TikTokService.actions.setGameName,TwitchService.actions.setGameInfo) but had no Kick branch, so after a Kick selection the form held the new id while the service still held the old one, and the next render read the service and reverted.Fixes
Give
KickServicea write-back method and call it from the selector, mirroring the Twitch branch that already sits beside it.setGameInfo({ gameId, gameName })writesUPDATE_STREAM_SETTINGS({ game: gameId, gameName })andSET_GAME_NAME(gameName), covering both the id the API needs and the name the component renders.Move the name inside
settingsso the saved-settings path can see it.gameName?: stringis added toIKickStartStreamSettingsandIKickStartStreamOptions, seeded as''ininitialState, and — critically — mirrored by theSET_GAME_NAMEmutation itself rather than at each call site.The top-level
state.gameNameis deliberately kept rather than replaced, becauseGameSelector.tsx:43still reads it.StreamInfoView.gameand.gameNamegain Kick clauses, so the common-field getters resolve for a Kick-only stream instead of returning''.searchGamesbuilds its query withURLSearchParams, matchingputChannelInfo, and guards the response withtypeof res !== 'object'before casting — logging a distinct message so a diagnostic log separates "the API answered with no categories" from "we never reached the API". Both paths still resolve to[], so callers are unaffected.fetchGamereturns an emptyIGamefor a falsy name instead of issuing a request.Files changed:
app/services/platforms/kick.ts,app/components-react/windows/go-live/GameSelector.tsx,app/services/streaming/streaming-view.tsPerformance Implications
Net reduction. The
fetchGameguard removes one HTTP request per app start, on the path that runs while the Go Live window is loading. Nothing new is requested. The costs are one optional string in Kick's settings object, one object spread perSET_GAME_NAMEcall, and two mutations on an explicit user selection — all negligible against the request they replace.