Skip to content

Commit

Permalink
Merge pull request #199 from SenteraLLC/fix/set-saved-loading-issue
Browse files Browse the repository at this point in the history
fix/set saved loading issue
  • Loading branch information
joshua-dean authored Oct 7, 2024
2 parents 4baa9ad + 31274bf commit 7daaf91
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ All notable changes to this project will be documented here.

Nothing yet.

## [0.15.3] - Oct 4th, 2024
- Fix issue where legacy submit button functionality would break loading

## [0.15.2] - Oct 4th, 2024
- Change `set_saved` on submit buttons to be a true boolean,
rather than an optional boolean that could needlessly force a reload prompt
Expand Down
2 changes: 1 addition & 1 deletion dist/ulabel.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ulabel.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ulabel",
"description": "An image annotation tool.",
"version": "0.15.2",
"version": "0.15.3",
"main": "dist/ulabel.js",
"module": "dist/ulabel.js",
"scripts": {
Expand All @@ -10,6 +10,7 @@
"build": "tsc && webpack --mode production",
"build-dev": "tsc && webpack --mode development",
"build-and-demo": "npm run build && npm run demo",
"build-dev-and-demo": "npm run build-dev && npm run demo",
"prepare": "husky"
},
"lint-staged": {
Expand Down
18 changes: 9 additions & 9 deletions src/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2417,15 +2417,6 @@ export class SubmitButtons extends ToolboxItem {
// Grab the submit buttons from ulabel
this.submit_buttons = ulabel.config.submit_buttons;

// Set `set_saved` to false if not provided
for (const button of this.submit_buttons) {
button.set_saved = button.set_saved ?? false;
}

this.add_styles();

this.add_event_listeners();

// For legacy reasons submit_buttons may be a function, in that case convert it to the right format
if (typeof this.submit_buttons == "function") {
this.submit_buttons = [{
Expand All @@ -2436,6 +2427,15 @@ export class SubmitButtons extends ToolboxItem {
}];
}

// Set `set_saved` to false if not provided
for (const button of this.submit_buttons) {
button.set_saved = button.set_saved ?? false;
}

this.add_styles();

this.add_event_listeners();

this.submit_buttons_by_row = this.sort_buttons_by_row_number();

for (const idx in this.submit_buttons) {
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ULABEL_VERSION = "0.15.2";
export const ULABEL_VERSION = "0.15.3";

0 comments on commit 7daaf91

Please sign in to comment.