mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-27 08:00:51 +01:00
Fix motto
This commit is contained in:
parent
2796abc718
commit
16e776a10b
@ -1,4 +1,4 @@
|
|||||||
import { CantConnectMessageParser, GenericErrorEvent, GetGuestRoomResultEvent, LegacyExternalInterface, NavigatorCategoriesComposer, NavigatorCategoriesEvent, NavigatorHomeRoomEvent, NavigatorMetadataEvent, NavigatorOpenRoomCreatorEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomCreatedEvent, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomDoorbellRejectedEvent, RoomEnterErrorEvent, RoomEntryInfoMessageEvent, RoomForwardEvent, RoomInfoComposer, RoomSettingsUpdatedEvent, UserInfoEvent } from '@nitrots/nitro-renderer';
|
import { CantConnectMessageParser, GenericErrorEvent, GetGuestRoomResultEvent, LegacyExternalInterface, NavigatorCategoriesComposer, NavigatorCategoriesEvent, NavigatorHomeRoomEvent, NavigatorMetadataEvent, NavigatorOpenRoomCreatorEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomCreatedEvent, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomDoorbellRejectedEvent, RoomEnterErrorEvent, RoomEntryInfoMessageEvent, RoomForwardEvent, RoomInfoComposer, RoomScoreEvent, RoomSettingsUpdatedEvent, UserInfoEvent } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback } from 'react';
|
import { FC, useCallback } from 'react';
|
||||||
import { CreateRoomSession, GetSessionDataManager, LocalizeText, NotificationAlertType, NotificationUtilities, SendMessageComposer, VisitDesktop } from '../../api';
|
import { CreateRoomSession, GetSessionDataManager, LocalizeText, NotificationAlertType, NotificationUtilities, SendMessageComposer, VisitDesktop } from '../../api';
|
||||||
import { NavigatorEvent, UpdateDoorStateEvent } from '../../events';
|
import { NavigatorEvent, UpdateDoorStateEvent } from '../../events';
|
||||||
@ -90,6 +90,22 @@ export const NavigatorMessageHandler: FC<{}> = props =>
|
|||||||
}
|
}
|
||||||
}, [ dispatchNavigatorState, navigatorState ]);
|
}, [ dispatchNavigatorState, navigatorState ]);
|
||||||
|
|
||||||
|
const onRoomScoreEvent = useCallback((event: RoomScoreEvent) =>
|
||||||
|
{
|
||||||
|
const parser = event.getParser();
|
||||||
|
|
||||||
|
const roomInfoData = navigatorState.roomInfoData;
|
||||||
|
roomInfoData.canRate = parser.canLike;
|
||||||
|
roomInfoData.enteredGuestRoom.score = parser.totalLikes;
|
||||||
|
|
||||||
|
dispatchNavigatorState({
|
||||||
|
type: NavigatorActions.SET_ROOM_INFO_DATA,
|
||||||
|
payload: {
|
||||||
|
roomInfoData: roomInfoData
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, [ dispatchNavigatorState, navigatorState ]);
|
||||||
|
|
||||||
const onRoomDoorbellEvent = useCallback((event: RoomDoorbellEvent) =>
|
const onRoomDoorbellEvent = useCallback((event: RoomDoorbellEvent) =>
|
||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
@ -230,6 +246,7 @@ export const NavigatorMessageHandler: FC<{}> = props =>
|
|||||||
UseMessageEventHook(RoomForwardEvent, onRoomForwardEvent);
|
UseMessageEventHook(RoomForwardEvent, onRoomForwardEvent);
|
||||||
UseMessageEventHook(RoomEntryInfoMessageEvent, onRoomEntryInfoMessageEvent);
|
UseMessageEventHook(RoomEntryInfoMessageEvent, onRoomEntryInfoMessageEvent);
|
||||||
UseMessageEventHook(GetGuestRoomResultEvent, onGetGuestRoomResultEvent);
|
UseMessageEventHook(GetGuestRoomResultEvent, onGetGuestRoomResultEvent);
|
||||||
|
UseMessageEventHook(RoomScoreEvent, onRoomScoreEvent);
|
||||||
UseMessageEventHook(RoomDoorbellEvent, onRoomDoorbellEvent);
|
UseMessageEventHook(RoomDoorbellEvent, onRoomDoorbellEvent);
|
||||||
UseMessageEventHook(RoomDoorbellAcceptedEvent, onRoomDoorbellAcceptedEvent);
|
UseMessageEventHook(RoomDoorbellAcceptedEvent, onRoomDoorbellAcceptedEvent);
|
||||||
UseMessageEventHook(RoomDoorbellRejectedEvent, onRoomDoorbellRejectedEvent);
|
UseMessageEventHook(RoomDoorbellRejectedEvent, onRoomDoorbellRejectedEvent);
|
||||||
|
Loading…
Reference in New Issue
Block a user