Skip to content

Commit 0168fc2

Browse files
committed
feat(game-stream): tell user when game is disconnected
1 parent 2df4edd commit 0168fc2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

electron/renderer/pages/game.tsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useEuiTheme } from '@elastic/eui';
21
import isEmpty from 'lodash-es/isEmpty.js';
32
import { useObservable } from 'observable-hooks';
43
import type { ReactNode } from 'react';
@@ -44,7 +43,6 @@ const GamePage: React.FC = (): ReactNode => {
4443
// TODO load the grid config items
4544
// TODO load the grid layout items
4645

47-
const { euiTheme } = useEuiTheme();
4846
const { colorMode } = useTheme();
4947

5048
const mainStreamId = getGameItemInfo(GameItemId.MAIN).streamId;
@@ -240,6 +238,18 @@ const GamePage: React.FC = (): ReactNode => {
240238
});
241239
});
242240

241+
useSubscribe(['game:disconnect'], () => {
242+
gameLogLineSubject$.next({
243+
eventId: uuid(),
244+
streamId: mainStreamId,
245+
styles: {
246+
colorMode,
247+
subdued: true,
248+
},
249+
text: `> GAME DISCONNECTED`,
250+
});
251+
});
252+
243253
const contentItems = useMemo<Array<GridItemContent>>(() => {
244254
// TODO define a default config set
245255
// TODO allow users to customize the config, and add/remove items

0 commit comments

Comments
 (0)