diff --git a/src/views/toolbar/ToolbarView.tsx b/src/views/toolbar/ToolbarView.tsx index a807308d..97e654eb 100644 --- a/src/views/toolbar/ToolbarView.tsx +++ b/src/views/toolbar/ToolbarView.tsx @@ -1,11 +1,12 @@ -import { Dispose, DropBounce, EaseOut, JumpBy, Motions, NitroToolbarAnimateIconEvent, Queue, UserFigureEvent, UserInfoDataParser, UserInfoEvent, Wait } from 'nitro-renderer'; +import { DesktopViewComposer, Dispose, DropBounce, EaseOut, JumpBy, Motions, NitroToolbarAnimateIconEvent, Queue, UserFigureEvent, UserInfoDataParser, UserInfoEvent, Wait } from 'nitro-renderer'; import { FC, useCallback, useState } from 'react'; +import { GetRoomSession, GetRoomSessionManager } from '../../api'; import { AvatarEditorEvent, CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent, RoomWidgetCameraEvent } from '../../events'; import { AchievementsUIEvent } from '../../events/achievements'; import { UnseenItemTrackerUpdateEvent } from '../../events/inventory/UnseenItemTrackerUpdateEvent'; import { ModToolsEvent } from '../../events/mod-tools/ModToolsEvent'; import { dispatchUiEvent, useRoomEngineEvent, useUiEvent } from '../../hooks'; -import { CreateMessageHook } from '../../hooks/messages/message-event'; +import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event'; import { TransitionAnimation } from '../../layout/transitions/TransitionAnimation'; import { TransitionAnimationTypes } from '../../layout/transitions/TransitionAnimation.types'; import { AvatarImageView } from '../shared/avatar-image/AvatarImageView'; @@ -124,6 +125,14 @@ export const ToolbarView: FC = props => } }, []); + const visitDesktop = useCallback(() => + { + if(!GetRoomSession()) return; + + SendMessageHook(new DesktopViewComposer()); + GetRoomSessionManager().removeSession(-1); + }, []); + return (
@@ -134,17 +143,17 @@ export const ToolbarView: FC = props =>
setMeExpanded(!isMeExpanded) }> - { userFigure && } +
{ (unseenAchievementsCount > 0) && (
{ unseenAchievementsCount }
) }
- {/* { isInRoom && ( -
- -
) } */} + { isInRoom && ( +
+ +
) } { !isInRoom && (