Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…DDara into fix/fe/channelName
  • Loading branch information
leedongyull committed Dec 5, 2024
2 parents 651f6a0 + 3fd85f1 commit a8be79f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/component/bottomsheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const BottomSheet = ({
return (
<>
<div
className={classNames('absolute bottom-14 z-[5000]')}
className={classNames('absolute bottom-14')}
style={{
height: `${sheetHeight * 100}vh`,
transition: 'height 0.3s ease-out',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/getUserLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface IGetUserLocation {
error: string | null;
}

interface IDeviceOrientationEventWithPermission extends DeviceOrientationEvent {
export interface IDeviceOrientationEventWithPermission extends DeviceOrientationEvent {
requestPermission?: () => Promise<'granted' | 'denied'>;
}

Expand Down
29 changes: 28 additions & 1 deletion frontend/src/pages/GuestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IPoint } from '@/lib/types/canvasInterface.ts';
import { guestEntity } from '@/api/dto/channel.dto.ts';
import { GuestMarker } from '@/component/IconGuide/GuestMarker.tsx';
import { LoadingSpinner } from '@/component/common/loadingSpinner/LoadingSpinner.tsx';
import { getUserLocation } from '@/hooks/getUserLocation.ts';
import { getUserLocation, IDeviceOrientationEventWithPermission } from '@/hooks/getUserLocation.ts';
import { loadLocalData, saveLocalData } from '@/utils/common/manageLocalData.ts';
import { AppConfig } from '@/lib/constants/commonConstants.ts';
import { v4 as uuidv4 } from 'uuid';
Expand All @@ -31,6 +31,33 @@ export const GuestView = () => {

const wsRef = useRef<WebSocket | null>(null);

useEffect(() => {
const requestOrientationPermission = async () => {
const DeviceOrientationEventTyped =
DeviceOrientationEvent as unknown as IDeviceOrientationEventWithPermission;

if (
typeof DeviceOrientationEventTyped !== 'undefined' &&
typeof DeviceOrientationEventTyped.requestPermission === 'function'
) {
try {
const permission = await DeviceOrientationEventTyped.requestPermission();
if (permission === 'granted') {
console.log('Device Orientation permission granted.');
} else {
console.error('Device Orientation permission denied.');
}
} catch {
console.error('Failed to request Device Orientation permission:');
}
} else {
console.warn('DeviceOrientationEvent.requestPermission is not supported on this browser.');
}
};

requestOrientationPermission();
}, []);

useEffect(() => {
// 소켓 연결 초기화
const token = loadLocalData(AppConfig.KEYS.BROWSER_TOKEN) || uuidv4();
Expand Down

0 comments on commit a8be79f

Please sign in to comment.