Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: OPTIC-218: 'Annotation saved successfully' message is NOT displayed when user exit label stream using 'Submit and exit' option #5362

Merged
merged 15 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/dist/libs/datamanager/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/datamanager/main.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions web/libs/datamanager/src/sdk/lsf-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,14 @@ export class LSFWrapper {
// don't react on duplicated annotations error
{ errorHandler: result => result.status === 409 },
);
}, false, loadNext, exitStream);
}, false, loadNext);
const status = result?.$meta?.status;

if (status === 200 || status === 201) this.datamanager.invoke("toast", { message: "Annotation saved successfully", type: "info" });
else if (status !== undefined) this.datamanager.invoke("toast", { message: "There was an error saving your Annotation", type: "error" });

if (exitStream) return this.exitStream();

};

/** @private */
Expand Down Expand Up @@ -854,7 +857,7 @@ export class LSFWrapper {
if (isFF(FF_OPTIC_2)) this.saveDraft();
this.loadTask(prevTaskId, prevAnnotationId, true);
}
async submitCurrentAnnotation(eventName, submit, includeId = false, loadNext = true, exitStream) {
async submitCurrentAnnotation(eventName, submit, includeId = false, loadNext = true) {
const { taskID, currentAnnotation } = this;
const unique_id = this.task.unique_lock_id;
const serializedAnnotation = this.prepareData(currentAnnotation, { includeId });
Expand Down Expand Up @@ -889,7 +892,6 @@ export class LSFWrapper {
}

this.setLoading(false);
if (exitStream) return this.exitStream();

if (!loadNext || this.datamanager.isExplorer) {
await this.loadTask(taskID, currentAnnotation.pk, true);
Expand Down
Loading