Skip to content

Commit 72030f4

Browse files
committed
restoring pause annotator
1 parent 7e176c0 commit 72030f4

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/pausing-annotator/plugin.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ LSI.on("submitAnnotation", async (_store, annotation) => {
136136
localStorage.setItem(key, "[]");
137137

138138
try {
139-
const response = await pause(result);
140-
Htx.showModal(`Annotation paused: ${response.verbose_reason}`, "info");
139+
await pause(result);
141140
} catch (error) {
142141
Htx.showModal(error.message, "error");
143142
}
@@ -154,11 +153,7 @@ LSI.on("submitAnnotation", async (_store, annotation) => {
154153
localStorage.setItem(key, "[]");
155154

156155
try {
157-
const response = await pause(result);
158-
Htx.showModal(
159-
`Annotation paused: ${response.verbose_reason}`,
160-
"info",
161-
);
156+
await pause(result);
162157
} catch (error) {
163158
Htx.showModal(error.message, "error");
164159
}

src/simple-content-moderation/plugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
*
44
* This plugin monitors text entered into TextArea regions and checks for the word "hate"
55
* before allowing the annotation to be saved. If found, it shows an error message and
6-
* prevents submission.
6+
* prevents submission. This would happen only once, if user clicks Submit again it would
7+
* work with no errors.
78
*
89
* The plugin uses Label Studio's beforeSaveAnnotation event which is triggered before
910
* an annotation is saved. Returning false from this event handler prevents the save

0 commit comments

Comments
 (0)