Skip to content

Commit f6c70f6

Browse files
committed
separate signedFiles counts from counts to report
1 parent c687b80 commit f6c70f6

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/dbp-official-signature-pdf-upload.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem
239239
this.errorFiles[Math.floor(Math.random() * 1000000)] = file;
240240
// this triggers the correct update() execution
241241
this.errorFilesCount++;
242+
this.errorFilesCountToReport++;
242243

243244
this.sendSetPropertyEvent('analytics-event', {
244245
category: 'officiallySigning',
@@ -258,6 +259,8 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem
258259
this.signedFiles.push(data.json);
259260
// this triggers the correct update() execution
260261
this.signedFilesCount++;
262+
this.signedFilesCountToReport++;
263+
261264
const entryPoint = data.json;
262265
this.currentFileName = entryPoint.name;
263266
this.endSigningProcessIfQueueEmpty();

src/dbp-qualified-signature-pdf-upload.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
314314
that.signedFiles.push(document);
315315
// this triggers the correct update() execution
316316
that.signedFilesCount++;
317+
that.signedFilesCountToReport++;
317318

318319
this.sendSetPropertyEvent('analytics-event', {
319320
category: 'QualifiedlySigning',
@@ -355,6 +356,7 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
355356
this.errorFiles[Math.floor(Math.random() * 1000000)] = file;
356357
// this triggers the correct update() execution
357358
this.errorFilesCount++;
359+
this.errorFilesCountToReport++;
358360

359361
this.sendSetPropertyEvent('analytics-event', {
360362
category: 'QualifiedlySigning',

src/dbp-signature-lit-element.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ export default class DBPSignatureLitElement extends BaseLitElement {
6262
this.nextcloudDefaultDir = '';
6363
this.signedFiles = [];
6464
this.signedFilesCount = 0;
65+
this.signedFilesCountToReport = 0;
6566
this.errorFiles = [];
6667
this.errorFilesCount = 0;
68+
this.errorFilesCountToReport = 0;
6769
this.selectedFiles = [];
6870
this.selectedFilesProcessing = false;
6971
this.initialQueuedFilesCount = 0;
@@ -81,10 +83,12 @@ export default class DBPSignatureLitElement extends BaseLitElement {
8183
nextcloudAuthInfo: {type: String, attribute: 'nextcloud-auth-info'},
8284
signedFiles: {type: Array, attribute: false},
8385
signedFilesCount: {type: Number, attribute: false},
86+
signedFilesCountToReport: {type: Number, attribute: false},
8487
signedFilesToDownload: {type: Number, attribute: false},
8588
queuedFilesCount: {type: Number, attribute: false},
8689
errorFiles: {type: Array, attribute: false},
8790
errorFilesCount: {type: Number, attribute: false},
91+
errorFilesCountToReport: {type: Number, attribute: false},
8892
uploadInProgress: {type: Boolean, attribute: false},
8993
uploadStatusFileName: {type: String, attribute: false},
9094
uploadStatusText: {type: String, attribute: false},
@@ -1491,24 +1495,24 @@ export default class DBPSignatureLitElement extends BaseLitElement {
14911495
const i18n = this._i18n;
14921496
if (this.queuedFilesCount === 0 || (this.selectedFilesProcessing && this.selectedFiles.length === 0)) {
14931497
this.selectedFilesProcessing = false;
1494-
if (this.signedFilesCount > 0) {
1498+
if (this.signedFilesCountToReport > 0) {
14951499
send({
14961500
summary: i18n.t('report-message-title'),
1497-
body: i18n.t('signed-document-report-message', {count: this.signedFilesCount}),
1501+
body: i18n.t('signed-document-report-message', {count: this.signedFilesCountToReport}),
14981502
type: 'success',
14991503
timeout: 20,
15001504
});
15011505
}
1502-
if (this.errorFilesCount > 0 ) {
1506+
if (this.errorFilesCountToReport > 0 ) {
15031507
send({
15041508
summary: i18n.t('report-message-title'),
1505-
body: i18n.t('failed-document-report-message', {count: this.errorFilesCount}),
1509+
body: i18n.t('failed-document-report-message', {count: this.errorFilesCountToReport}),
15061510
type: 'danger',
15071511
timeout: 20,
15081512
});
15091513
}
1510-
this.signedFilesCount = 0;
1511-
this.errorFilesCount = 0;
1514+
this.signedFilesCountToReport = 0;
1515+
this.errorFilesCountToReport = 0;
15121516
}
15131517
}
15141518
}

0 commit comments

Comments
 (0)