mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 10:22:36 +01:00
changes
This commit is contained in:
parent
cd3ffcd272
commit
7f0a194b34
@ -1,4 +1,4 @@
|
||||
import { ConfigurationEvent, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroEvent, NitroLocalizationEvent, NitroVersion, RoomEngineEvent, WebGL } from '@nitrots/nitro-renderer';
|
||||
import { ConfigurationEvent, HabboWebTools, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroEvent, NitroLocalizationEvent, NitroVersion, RoomEngineEvent, WebGL } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetCommunication, GetConfiguration, GetNitroInstance } from './api';
|
||||
import { useConfigurationEvent } from './hooks/events/core/configuration/configuration-event';
|
||||
@ -68,6 +68,8 @@ export const App: FC<{}> = props =>
|
||||
setMessage('Finishing Up');
|
||||
|
||||
GetNitroInstance().init();
|
||||
|
||||
if(LegacyExternalInterface.available) LegacyExternalInterface.call('legacyTrack', 'authentication', 'authok', []);
|
||||
return;
|
||||
case NitroCommunicationDemoEvent.CONNECTION_ERROR:
|
||||
setIsError(true);
|
||||
@ -79,7 +81,7 @@ export const App: FC<{}> = props =>
|
||||
setIsError(true);
|
||||
setMessage('Connection Error');
|
||||
|
||||
LegacyExternalInterface.call('disconnect', -1, 'client.init.handshake.fail');
|
||||
HabboWebTools.send(-1, 'client.init.handshake.fail');
|
||||
return;
|
||||
case RoomEngineEvent.ENGINE_INITIALIZED:
|
||||
setIsReady(true);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { GenericErrorEvent, GetGuestRoomResultEvent, NavigatorCategoriesComposer, NavigatorCategoriesEvent, NavigatorHomeRoomEvent, NavigatorMetadataEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomCreatedEvent, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomDoorbellRejectedEvent, RoomEntryInfoMessageEvent, RoomForwardEvent, RoomInfoComposer, RoomSettingsUpdatedEvent, UserInfoEvent } from '@nitrots/nitro-renderer';
|
||||
import { GenericErrorEvent, GetGuestRoomResultEvent, LegacyExternalInterface, NavigatorCategoriesComposer, NavigatorCategoriesEvent, NavigatorHomeRoomEvent, NavigatorMetadataEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomCreatedEvent, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomDoorbellRejectedEvent, RoomEntryInfoMessageEvent, RoomForwardEvent, RoomInfoComposer, RoomSettingsUpdatedEvent, UserInfoEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { CreateRoomSession, GetSessionDataManager } from '../../api';
|
||||
import { UpdateDoorStateEvent } from '../../events';
|
||||
@ -41,6 +41,8 @@ export const NavigatorMessageHandler: FC<NavigatorMessageHandlerProps> = props =
|
||||
});
|
||||
|
||||
SendMessageHook(new RoomInfoComposer(parser.roomId, true, false));
|
||||
|
||||
if(LegacyExternalInterface.available) LegacyExternalInterface.call('legacyTrack', 'navigator', 'private', [ parser.roomId ]);
|
||||
}, [ navigatorState, dispatchNavigatorState ]);
|
||||
|
||||
const onGetGuestRoomResultEvent = useCallback((event: GetGuestRoomResultEvent) =>
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { MouseEventType } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { AddEventLinkTracker, CreateLinkEvent, GetConfiguration, RemoveLinkEventTracker } from '../../api';
|
||||
import { AddEventLinkTracker, GetConfiguration, RemoveLinkEventTracker } from '../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../layout';
|
||||
import { NotificationUtilities } from '../notification-center/common/NotificationUtilities';
|
||||
|
||||
const newLineRegex = /\n\r|\n|\r/mg;
|
||||
const internalLinkPrefix = 'event:';
|
||||
export const NitropediaView: FC<{}> = props =>
|
||||
{
|
||||
const [ content, setContent ] = useState<string>(null);
|
||||
@ -40,17 +40,7 @@ export const NitropediaView: FC<{}> = props =>
|
||||
{
|
||||
event.preventDefault();
|
||||
const link = event.target.href;
|
||||
|
||||
if(link.startsWith(internalLinkPrefix))
|
||||
{
|
||||
const internalLink = link.substring(internalLinkPrefix.length);
|
||||
CreateLinkEvent(internalLink);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
window.open(link);
|
||||
}
|
||||
NotificationUtilities.openUrl(link);
|
||||
}
|
||||
|
||||
},[]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user