fix(B03): rerun analysis on reupload
Clear derived browser caches so B05 loads the newly generated route and section data.
This commit is contained in:
@@ -11,8 +11,11 @@ import { createGeneralLayout } from "@ui/ui_template_general_layout";
|
||||
import { createWorkflowOverlays } from "@ui/ui_template_overlay";
|
||||
import { createStepBar, WORKFLOW_STEP_ICONS } from "@ui/ui_template_workflow_layout";
|
||||
import { fetchUploadOverview, type UploadedFileResult } from "./B03_FileInput_Api_Fetch";
|
||||
import { clearPreloadMark } from "../A00_Common/b_asset_cache";
|
||||
import { navigateTo } from "../A00_Common/router";
|
||||
import { attachTempBatch } from "../B01_Dashboard/B01_Dashboard_Api_Temp";
|
||||
import { clearRouteLatestCache } from "../B05_Profile/B05_Profile_Api_Fetch";
|
||||
import { invalidateSectionDetail } from "../B06_Section/B06_Section_Section_Store";
|
||||
import { createTempPicker } from "./B03_FileInput_UI_TempPicker";
|
||||
import { workflowSteps } from "../A00_Common/b_page_scaffold";
|
||||
import {
|
||||
@@ -64,6 +67,12 @@ export async function renderB03FileInput(root: HTMLElement): Promise<void> {
|
||||
let pageRoot: HTMLElement | null = null;
|
||||
let isUploading = false;
|
||||
|
||||
function clearDerivedCaches(projectId: string): void {
|
||||
clearRouteLatestCache(projectId);
|
||||
invalidateSectionDetail(projectId);
|
||||
clearPreloadMark();
|
||||
}
|
||||
|
||||
const subtitle = document.createElement("p");
|
||||
subtitle.className = "b03-file__subtitle";
|
||||
subtitle.textContent = L("B03_File_Subtitle");
|
||||
@@ -488,6 +497,7 @@ export async function renderB03FileInput(root: HTMLElement): Promise<void> {
|
||||
pageError.textContent = "";
|
||||
try {
|
||||
const result = await attachTempBatch(activeProjectId, batch.batch_id);
|
||||
clearDerivedCaches(activeProjectId);
|
||||
tempPicker.clear();
|
||||
showToast(L("B03_Temp_Attach_Success"), "success");
|
||||
await applyUploadOverview();
|
||||
@@ -563,15 +573,10 @@ export async function renderB03FileInput(root: HTMLElement): Promise<void> {
|
||||
)),
|
||||
);
|
||||
}
|
||||
clearDerivedCaches(activeProjectId);
|
||||
renderUploadResults(resultList, uploaded);
|
||||
showToast(L("B03_File_Upload_Success"), "success");
|
||||
|
||||
// 모든 파일이 기존 파일과 같으면 새 분석이 시작되지 않는다.
|
||||
if (uploaded.length === 0) {
|
||||
navigateTo(completionRoute);
|
||||
return;
|
||||
}
|
||||
|
||||
showToast(L("B03_File_Analysis_InProgress"), "info");
|
||||
const analysisComplete = await pollAnalysis(activeProjectId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user