diff --git a/tracker/tracker/package.json b/tracker/tracker/package.json index 6d5021eb4..f51339ce2 100644 --- a/tracker/tracker/package.json +++ b/tracker/tracker/package.json @@ -1,7 +1,7 @@ { "name": "@openreplay/tracker", "description": "The OpenReplay tracker main package", - "version": "11.0.0-beta.4", + "version": "11.0.0-beta.5", "keywords": [ "logging", "replay" diff --git a/tracker/tracker/src/main/modules/userTesting/index.ts b/tracker/tracker/src/main/modules/userTesting/index.ts index 24ce9a2c9..b2c97edb2 100644 --- a/tracker/tracker/src/main/modules/userTesting/index.ts +++ b/tracker/tracker/src/main/modules/userTesting/index.ts @@ -528,6 +528,7 @@ export default class UserTestManager { } showEndSection() { + let isLoading = true void this.signalTest('done') const section = createElement('div', 'end_section_or', styles.endSectionStyle) const title = createElement( @@ -548,12 +549,20 @@ export default class UserTestManager { '\n' + 'We appreciate your time and valuable input.', ) + const button = createElement( + 'div', + 'end_button_or', + styles.buttonWidgetStyle, + 'Uploading session...', + ) + if (this.test?.reqMic || this.test?.reqCamera) { - this.userRecorder.sendToAPI().then(() => { + void this.userRecorder.sendToAPI().then(() => { title.textContent = 'Thank you! 👍' + button.textContent = 'End Session' + isLoading = false }) } - const button = createElement('div', 'end_button_or', styles.buttonWidgetStyle, 'End Session') if (this.taskSection) { this.container.removeChild(this.taskSection) @@ -566,6 +575,8 @@ export default class UserTestManager { } button.onclick = () => { + if (isLoading) return + window.close() document.body.removeChild(this.bg) } section.append(title, description, button)