Update
This commit is contained in:
@@ -8,7 +8,6 @@ import useVideoEditorStore from '@/stores/VideoEditorStore';
|
||||
// Import fonts first - this loads all Fontsource packages
|
||||
import '@/modules/editor/fonts';
|
||||
|
||||
import UpgradeSheet from '../upgrade/upgrade-sheet';
|
||||
import EditNavSidebar from './partials/edit-nav-sidebar';
|
||||
import EditSidebar from './partials/edit-sidebar';
|
||||
import EditorAISheet from './partials/editor-ai-sheet';
|
||||
@@ -218,7 +217,7 @@ const Editor = () => {
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<UpgradeSheet />
|
||||
{/* <UpgradeSheet /> */}
|
||||
<EditorAISheet />
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ const VideoDownloadModal = ({
|
||||
const lastProgressTime = useRef(null);
|
||||
const lastProgress = useRef(0);
|
||||
|
||||
const { premiumExportRequest, premiumExportComplete } = useUserStore();
|
||||
const { premiumExportRequest, premiumExportComplete, basicExportRequest, basicExportComplete } = useUserStore();
|
||||
|
||||
const handleShareOrDownload = async () => {
|
||||
if (!videoBlob || !videoBlobFilename) {
|
||||
@@ -116,11 +116,28 @@ const VideoDownloadModal = ({
|
||||
}
|
||||
};
|
||||
|
||||
const handleExportWithWatermark = () => {
|
||||
const handleExportWithWatermark = async () => {
|
||||
setIsPremiumExport(false);
|
||||
setEstimatedTimeRemaining(null);
|
||||
setStatus('processing');
|
||||
handleDownloadButton();
|
||||
|
||||
// Call basicExportRequest and check response
|
||||
const response = await basicExportRequest();
|
||||
|
||||
if (response?.error) {
|
||||
// Halt the process if there's an error
|
||||
setIsPremiumExport(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (response?.success) {
|
||||
// Store the export token
|
||||
const token = response.success.data.export_token;
|
||||
console.log('Received basic export token:', token);
|
||||
setExportToken(token);
|
||||
// Continue with export if successful
|
||||
setStatus('processing');
|
||||
handleDownloadButton();
|
||||
}
|
||||
};
|
||||
|
||||
const handleClose = async () => {
|
||||
@@ -140,15 +157,18 @@ const VideoDownloadModal = ({
|
||||
useEffect(() => {
|
||||
if (status === 'processing' && exportProgress >= 100) {
|
||||
setStatus('complete');
|
||||
// Call premiumExportComplete immediately when export completes
|
||||
// Call appropriate export complete method based on export type
|
||||
if (isPremiumExport && exportToken) {
|
||||
console.log('Calling premiumExportComplete with token:', exportToken);
|
||||
premiumExportComplete(exportToken);
|
||||
} else if (isPremiumExport && !exportToken) {
|
||||
console.error('Premium export completed but no token available');
|
||||
} else if (!isPremiumExport && exportToken) {
|
||||
console.log('Calling basicExportComplete with token:', exportToken);
|
||||
basicExportComplete(exportToken);
|
||||
} else if (!exportToken) {
|
||||
console.error('Export completed but no token available');
|
||||
}
|
||||
}
|
||||
}, [exportProgress, status, isPremiumExport, exportToken, premiumExportComplete]);
|
||||
}, [exportProgress, status, isPremiumExport, exportToken, premiumExportComplete, basicExportComplete]);
|
||||
|
||||
// Calculate estimated time remaining based on progress speed
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user