Skip to content

Commit

Permalink
feat: [FE] 로컬에서 불러오는 경우도 이름과 타입을 불러오도록 처리
Browse files Browse the repository at this point in the history
로컬에서 불러오는 경우도 이름과 타입을 불러오도록 처리
  • Loading branch information
d0422 committed Nov 30, 2023
1 parent 727c81b commit 4cfd900
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontEnd/src/components/room/editor/LoadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import LoginModal from '../modal/LoginModal';
import createAuthFailCallback from '@/utils/authFailCallback';
import sendMessageDataChannels from '@/utils/sendMessageDataChannels';
import { DataChannel } from '@/types/RTCConnection';
import { EDITOR_LANGUAGE_TYPES } from '@/constants/editor';

function LoadButtonElement({ children, onClick }: { children: React.ReactNode; onClick: React.MouseEventHandler<HTMLButtonElement> }) {
return (
Expand Down Expand Up @@ -35,7 +36,7 @@ export default function LoadButton({ plainCode, setPlainCode, setLanguageName, s

const handleLoadLocalCodeFile = () => {
uploadLocalFile((name, code, languageName) => {
setFileName(name);
setFileName(`${name}.${EDITOR_LANGUAGE_TYPES[languageName].extension}`);
setPlainCode(code);
setLanguageName(languageName);

Expand Down

0 comments on commit 4cfd900

Please sign in to comment.