mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-27 08:00:51 +01:00
close on room leave
This commit is contained in:
parent
ee060670dc
commit
96e83fdd31
@ -1,8 +1,8 @@
|
|||||||
import { FloorHeightMapEvent, NitroPoint, RoomVisualizationSettingsEvent, UpdateFloorPropertiesMessageComposer } from '@nitrots/nitro-renderer';
|
import { FloorHeightMapEvent, NitroPoint, RoomEngineEvent, RoomVisualizationSettingsEvent, UpdateFloorPropertiesMessageComposer } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useEffect, useState } from 'react';
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
import { LocalizeText } from '../../api';
|
import { LocalizeText } from '../../api';
|
||||||
import { FloorplanEditorEvent } from '../../events/floorplan-editor/FloorplanEditorEvent';
|
import { FloorplanEditorEvent } from '../../events/floorplan-editor/FloorplanEditorEvent';
|
||||||
import { CreateMessageHook, SendMessageHook, useUiEvent } from '../../hooks';
|
import { CreateMessageHook, SendMessageHook, useRoomEngineEvent, useUiEvent } from '../../hooks';
|
||||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView, NitroLayoutFlex, NitroLayoutGrid, NitroLayoutGridColumn } from '../../layout';
|
import { NitroCardContentView, NitroCardHeaderView, NitroCardView, NitroLayoutFlex, NitroLayoutGrid, NitroLayoutGridColumn } from '../../layout';
|
||||||
import { FloorplanEditor } from './common/FloorplanEditor';
|
import { FloorplanEditor } from './common/FloorplanEditor';
|
||||||
import { convertNumbersForSaving, convertSettingToNumber } from './common/Utils';
|
import { convertNumbersForSaving, convertSettingToNumber } from './common/Utils';
|
||||||
@ -50,6 +50,13 @@ export const FloorplanEditorView: FC<{}> = props =>
|
|||||||
FloorplanEditor.instance.initialize();
|
FloorplanEditor.instance.initialize();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const onRoomEngineEvent = useCallback((event: RoomEngineEvent) =>
|
||||||
|
{
|
||||||
|
setIsVisible(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useRoomEngineEvent(RoomEngineEvent.DISPOSED, onRoomEngineEvent);
|
||||||
|
|
||||||
const onFloorHeightMapEvent = useCallback((event: FloorHeightMapEvent) =>
|
const onFloorHeightMapEvent = useCallback((event: FloorHeightMapEvent) =>
|
||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
Loading…
Reference in New Issue
Block a user