Skip to content
Merged
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
13 changes: 6 additions & 7 deletions client/src/vue_components/show/config/script/ScriptEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -712,18 +712,17 @@ export default {
if (!this.IS_CUT_MODE) {
if (this.scriptChanges) {
this.savingInProgress = true;
this.totalSavePages = Object.keys(this.TMP_SCRIPT).length;
const tmpPageKeys = Object.keys(this.TMP_SCRIPT).map((x) => Number.parseInt(x, 10));
const maxPage = Math.max(this.currentMaxPage, ...tmpPageKeys, 0);
this.totalSavePages = maxPage;
this.curSavePage = 0;
this.$bvModal.show('save-script');

const orderedPages = Object.keys(this.TMP_SCRIPT)
.map((x) => parseInt(x, 10))
.sort((a, b) => a - b);

for (const pageNo of orderedPages) {
for (let pageNo = 1; pageNo <= maxPage; pageNo++) {
this.curSavePage = pageNo;
// Check whether the page actually has any lines on it, and if not then skip
const tmpScriptPage = this.TMP_SCRIPT[pageNo.toString()];
if (!tmpScriptPage) continue;
// Check whether the page actually has any lines on it, and if not then skip
if (tmpScriptPage.length !== 0) {
// Check the actual script to see if the page exists or not
const actualScriptPage = this.GET_SCRIPT_PAGE(pageNo);
Expand Down
Loading