Skip to content

Commit 36a9b40

Browse files
committed
fixes
1 parent f310412 commit 36a9b40

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamTaskInfoPanel.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function StreamTaskInfoPanel({
4848
const result = JSON.stringify(assert?.result || assert?.value);
4949

5050
const id = player?.id || 0;
51+
const clanId = player?.clanId;
5152
const isWinner = output?.status === 'ok';
5253

5354
return (
@@ -92,7 +93,7 @@ function StreamTaskInfoPanel({
9293
)
9394
}
9495
>
95-
{renderImg(id, imgStyle)}
96+
{renderImg(clanId, imgStyle)}
9697
</div>
9798
</div>
9899
</div>

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamWidget.jsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import useSearchParams from '@/utils/useSearchParams';
1111

1212
import * as machineSelectors from '../../machines/selectors';
1313
import { connectToStream } from '../../middlewares/Stream';
14+
import { actions } from '../../slices';
1415

1516
import StreamEditorPanel from './StreamEditorPanel';
1617
import StreamFullPanel from './StreamFullPanel';
@@ -66,11 +67,16 @@ function StreamWidget({
6667
const widthInfoPanelPercentage = toPrcStr(searchParams.has('widthInfoPanel') ? searchParams.get('widthInfoPanel') : 40);
6768
const widthEditorPanelPercentage = toPrcStr(searchParams.has('widthEditorPanel') ? searchParams.get('widthEditorPanel') : 60);
6869
const outputTitleWidth = toPrcStr(searchParams.has('outputTitleWidth') ? searchParams.get('outputTitleWidth') : 25);
70+
const progressGifSize = toPxlStr(searchParams.has('progressGifSize') ? searchParams.get('progressGifSize') : 100);
71+
const winGifSize = toPxlStr(searchParams.has('winGifSize') ? searchParams.get('winGifSize') : 100);
6972

7073
const { mainService, waitingRoomService } = useGameRoomMachine({
7174
mainMachine,
7275
taskMachine,
7376
waitingRoomMachine,
77+
options: {
78+
withoutModals: false,
79+
},
7480
});
7581

7682
const roomMachineState = useMachineStateSelector(
@@ -90,6 +96,7 @@ function StreamWidget({
9096
const channel = setGameChannel(game.id);
9197

9298
const options = { cancelRedirect: true };
99+
dispatch(actions.clearGamePlayers());
93100
connectToGame(mainService, waitingRoomService, options)(dispatch);
94101

95102
const clearChannel = () => {
@@ -140,6 +147,8 @@ function StreamWidget({
140147
testBarHeight={testBarHeight}
141148
testBarWinGifTop={testBarWinGifTop}
142149
testBarProgressGifTop={testBarProgressGifTop}
150+
progressGifSize={progressGifSize}
151+
winGifSize={winGifSize}
143152
/>
144153
)}
145154
{orientations.LEFT === orientation && (
@@ -168,6 +177,8 @@ function StreamWidget({
168177
testBarProgressGifTop={testBarProgressGifTop}
169178
width={widthEditorPanelPercentage}
170179
taskHeaderFontSize={taskHeaderFontSize}
180+
progressGifSize={progressGifSize}
181+
winGifSize={winGifSize}
171182
/>
172183
</div>
173184
)}
@@ -183,6 +194,8 @@ function StreamWidget({
183194
testBarProgressGifTop={testBarProgressGifTop}
184195
width={widthEditorPanelPercentage}
185196
taskHeaderFontSize={taskHeaderFontSize}
197+
progressGifSize={progressGifSize}
198+
winGifSize={winGifSize}
186199
/>
187200
<StreamTaskInfoPanel
188201
game={game}

services/app/apps/codebattle/assets/js/widgets/slices/game.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ const game = createSlice({
2626
updateRematchStatus: (state, { payload }) => {
2727
Object.assign(state.gameStatus, payload);
2828
},
29+
clearGamePlayers: state => {
30+
if (state.game?.players) {
31+
state.game.players = {};
32+
}
33+
},
2934
updateGamePlayers: (state, { payload: { players: playersList } }) => {
3035
const newPlayersState = playersList.reduce(
3136
setPlayerToSliceState,

0 commit comments

Comments
 (0)