Skip to content

Commit 5502d58

Browse files
fix: FIT-694: Import from Data Manager is NOT working when navigating via browser Back button from Settings page (#8464)
Co-authored-by: yyassi-heartex <[email protected]>
1 parent 4e1d8f5 commit 5502d58

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

web/apps/labelstudio/src/pages/DataManager/DataManager.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,27 +112,27 @@ export const DataManagerPage = ({ ...props }) => {
112112
}
113113

114114
if (isMissingTaskError) {
115-
history.push(buildLink("", { id: params.id }));
115+
history.push(buildLink("", { id: params?.id ?? project?.id }));
116116
} else if (isMissingProjectError) {
117117
history.push("/projects");
118118
}
119119
});
120120

121121
dataManager.on("settingsClicked", () => {
122-
history.push(buildLink("/settings/labeling", { id: params.id }));
122+
history.push(buildLink("/settings/labeling", { id: params?.id ?? project?.id }));
123123
});
124124

125125
dataManager.on("importClicked", () => {
126-
history.push(buildLink("/data/import", { id: params.id }));
126+
history.push(buildLink("/data/import", { id: params?.id ?? project?.id }));
127127
});
128128

129129
// Navigate to Storage Settings and auto-open Add Source Storage modal
130130
dataManager.on("openSourceStorageModal", () => {
131-
history.push(buildLink("/settings/storage?open=source", { id: params.id }));
131+
history.push(buildLink("/settings/storage?open=source", { id: params?.id ?? project?.id }));
132132
});
133133

134134
dataManager.on("exportClicked", () => {
135-
history.push(buildLink("/data/export", { id: params.id }));
135+
history.push(buildLink("/data/export", { id: params?.id ?? project?.id }));
136136
});
137137

138138
dataManager.on("error", (response) => {
@@ -146,7 +146,7 @@ export const DataManagerPage = ({ ...props }) => {
146146
dataManager.on("navigate", (route) => {
147147
const target = route.replace(/^projects/, "");
148148

149-
if (target) history.push(buildLink(target, { id: params.id }));
149+
if (target) history.push(buildLink(target, { id: params?.id ?? project?.id }));
150150
else history.push("/projects");
151151
});
152152

web/libs/frontend-test/src/helpers/utils/media/SyncGroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class SyncGroup {
88
this.views = views;
99
}
1010

11-
checkSynchronization(tolerance = 0.01, maxShiftAlias: string | null = null, attempts = 3) {
11+
checkSynchronization(tolerance = 0.01, maxShiftAlias: string | null = null, attempts = 5) {
1212
const mediaChains = this.views.map((view) => view.mediaElement);
1313

1414
mediaChains[0].then((baseMedia) => {

0 commit comments

Comments
 (0)