Skip to content

Commit

Permalink
feature-074: 한글 입력 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
whistleJs committed Feb 20, 2024
1 parent 1b6d437 commit cbb6146
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/components/Home/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const ProgressBar = () => {

{['CONTINUE', 'STOP', 'ERROR'].includes(status) && (
<div className="converting-text">
<button
{/* <button
className="converting-btn"
style={{
backgroundColor:
Expand All @@ -77,7 +77,7 @@ const ProgressBar = () => {
}}
>
{status === 'CONTINUE' ? '변환중지' : '다시 시작'}
</button>
</button> */}

<div className="converting-percentage">{modelingProgress}%</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const NoteItem = ({
) => {
if (e.key === 'Escape') {
onDisableEditable();
} else if (e.key === 'Enter') {
} else if (e.key === 'Enter' && !e.nativeEvent.isComposing) {
e.preventDefault();

onEditAndNext && onEditAndNext(noteText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ const ScriptContentEditor = ({ content, onChange }: Props) => {
className="script-content-edit"
contentEditable
dangerouslySetInnerHTML={{ __html: content }}
onInput={({ target }) => {
onKeyDown={({ target, nativeEvent }) => {
if (nativeEvent.isComposing) return;
caretPos.current = getCaret(contentRef.current as HTMLDivElement);
onChange((target as HTMLDivElement).innerText);
}}
onBlur={({ target }) => onChange((target as HTMLDivElement).innerText)}
/>
);
};
Expand Down
19 changes: 4 additions & 15 deletions src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { useEffect, useRef, useState } from 'react';
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
import { useRecoilValue, useSetRecoilState } from 'recoil';
import { IVideoProps } from 'types/videos';

import {
getRecentVideos,
getAllDummyVideos,
createDummyVideoToMine,
createVideoAPI,
} from '@/apis/videos';

import SearchYoutube from '@/components/Home/SearchYoutube';
Expand All @@ -15,6 +14,7 @@ import InsightVideos from '@/components/Home/InsightVideos';
import RecommendationModal from '@/components/modals/RecommendationModal';

import useCreateToast from '@/hooks/useCreateToast';
import useCreateVideo from '@/hooks/useCreateVideo';

import { HomePageContainer } from '@/styles/HomepageStyle';

Expand All @@ -27,12 +27,13 @@ const HomePage: React.FC = () => {
const userToken = useRecoilValue(userTokenState);
const isOpenModal = useRecoilValue(recommendationModalState);
const setIsSideBarOpen = useSetRecoilState(isSideBarOpenState);
const [modelingData, setModelingData] = useRecoilState(modelingDataState);
const setModelingData = useSetRecoilState(modelingDataState);

const [recentVideos, setRecentVideos] = useState<IVideoProps[]>([]);
const [dummyVideos, setDummyVideos] = useState<IVideoProps[]>([]);

const { createToast } = useCreateToast();
const { createVideo } = useCreateVideo();

const searchRef = useRef(null);

Expand Down Expand Up @@ -69,18 +70,6 @@ const HomePage: React.FC = () => {
}, [setIsSideBarOpen, userToken]);

useEffect(() => {
const createVideo = async () => {
if (!modelingData) return;

try {
await createVideoAPI(modelingData);
} catch (e) {
console.error(e);
}

setModelingData(null);
};

if (userToken) {
createVideo();
} else {
Expand Down

0 comments on commit cbb6146

Please sign in to comment.