예약 업로드 충돌 시 실제 예약 시간 반환
This commit is contained in:
1 parent
cb68b2da97
commit
429c8d4708
5 files changed
+37
-7
No files matched your search
@@ -157,6 +157,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
const [uploadVideoTitle, setUploadVideoTitle] = useState<string>('');
|
||||
const [uploadChannelName, setUploadChannelName] = useState<string>('');
|
||||
const [uploadIsScheduled, setUploadIsScheduled] = useState(false);
|
||||
const [uploadScheduledAt, setUploadScheduledAt] = useState<string | null>(null);
|
||||
|
||||
// 드롭다운 외부 클릭 시 닫기
|
||||
useEffect(() => {
|
||||
@@ -373,12 +374,13 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
// 예약 업로드: 폴링 없이 바로 완료 처리
|
||||
setUploadStatus('completed');
|
||||
setUploadProgress(100);
|
||||
setUploadScheduledAt(uploadResponse.scheduled_at ?? null);
|
||||
onClose();
|
||||
resetForm();
|
||||
} else {
|
||||
// 즉시 업로드: 완료될 때까지 폴링
|
||||
const result = await waitForUploadComplete(
|
||||
uploadResponse.upload_id,
|
||||
uploadResponse.upload_id.toString(),
|
||||
(status, progress) => {
|
||||
setUploadStatus(status as UploadStatus);
|
||||
setUploadProgress(progress || 0);
|
||||
@@ -432,6 +434,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
setUploadVideoTitle('');
|
||||
setUploadChannelName('');
|
||||
setUploadIsScheduled(false);
|
||||
setUploadScheduledAt(null);
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
@@ -461,6 +464,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||
youtubeUrl={uploadYoutubeUrl}
|
||||
errorMessage={uploadErrorMessage}
|
||||
isScheduled={uploadIsScheduled}
|
||||
scheduledAt={uploadScheduledAt}
|
||||
onGoToCalendar={onGoToCalendar}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ interface UploadProgressModalProps {
|
||||
youtubeUrl?: string;
|
||||
errorMessage?: string;
|
||||
isScheduled?: boolean;
|
||||
scheduledAt?: string | null;
|
||||
onGoToCalendar?: () => void;
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
|
||||
youtubeUrl,
|
||||
errorMessage,
|
||||
isScheduled = false,
|
||||
scheduledAt,
|
||||
onGoToCalendar,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
@@ -148,6 +150,28 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
|
||||
{t('upload.viewOnYoutube')}
|
||||
</a>
|
||||
)}
|
||||
|
||||
{/* Scheduled conflict notice */}
|
||||
{status === 'completed' && isScheduled && scheduledAt && (
|
||||
<div className="upload-progress-schedule-notice">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<line x1="12" y1="8" x2="12" y2="12" />
|
||||
<line x1="12" y1="16" x2="12.01" y2="16" />
|
||||
</svg>
|
||||
<span>
|
||||
{t('upload.scheduleConflict', {
|
||||
time: new Date(scheduledAt).toLocaleString('ko-KR', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
}),
|
||||
})}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Footer */}
|
||||
|
||||
Reference in new issue
Block a user