Skip to content

Commit 58acdb2

Browse files
committed
fix: refetch migration block info when the import is completed
After the import process is completed, it is required to refetch migration block info else the page shows 0 components.
1 parent e973b59 commit 58acdb2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/library-authoring/import-course/ImportDetailsPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export const ImportDetailsPage = () => {
7171
const {
7272
data: migrationBlockInfo,
7373
isPending: isPendingMigrationBlockInfo,
74+
refetch: refetchMigrationBlockInfo,
7475
} = useMigrationBlocksInfo(
7576
libraryId,
7677
undefined,
@@ -81,7 +82,7 @@ export const ImportDetailsPage = () => {
8182

8283
const isPending = isPendingCourseDetails || isPendingMigrationStatusData || isPendingMigrationBlockInfo;
8384

84-
// Build migration summary using the mibration blocks info
85+
// Build migration summary using the migration blocks info
8586
const {
8687
migrationSummary,
8788
unsupportedBlockIds,
@@ -145,6 +146,8 @@ export const ImportDetailsPage = () => {
145146
// The entire task has failed
146147
migrationStatus = 'Failed';
147148
} else if (migrationStatusData?.state === 'Succeeded') {
149+
// refetch migrationBlockInfo data once the import is complete
150+
refetchMigrationBlockInfo();
148151
// Currently, bulk migrate is being used to migrate courses because
149152
// it has the ability to create collections.
150153
// In bulk migration, the task may succeed, but each migration may fail.

0 commit comments

Comments
 (0)