diff --git a/package-lock.json b/package-lock.json index 2a8f8fe..e823bfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "noisedash", - "version": "0.6.2", + "version": "0.6.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5dbe97a..06eb541 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "noisedash", - "version": "0.6.2", + "version": "0.6.3", "private": true, "author": "Kay Thomas (https://kaythomas.dev)", "scripts": { diff --git a/server/app.js b/server/app.js index 81ec794..7c4b053 100644 --- a/server/app.js +++ b/server/app.js @@ -36,7 +36,8 @@ app.use(session({ store: new FileStore(fileStoreOptions), secret: sessionSecret, resave: true, - saveUninitialized: true + saveUninitialized: true, + cookie: { sameSite: 'strict' } })) app.use((req, res, next) => { const msgs = req.session.messages || [] diff --git a/src/components/NoisePage.vue b/src/components/NoisePage.vue index cb55d14..d68b92d 100644 --- a/src/components/NoisePage.vue +++ b/src/components/NoisePage.vue @@ -50,7 +50,7 @@ label="Profiles" class="mx-3 mb-5" :disabled="playDisabled" - @change="loadProfile" + @change="loadProfile(true)" /> @@ -788,7 +788,7 @@ value="continuous" /> diff --git a/src/components/noise.js b/src/components/noise.js index 5a14998..4a60d98 100644 --- a/src/components/noise.js +++ b/src/components/noise.js @@ -344,7 +344,7 @@ export default { } this.exportedProfile = this.profileItems[0] this.recordedProfile = this.profileItems[0] - this.loadProfile() + this.loadProfile(true) } } }) @@ -420,8 +420,8 @@ export default { this.errorSnackbar = true }) }, - loadProfile () { - if (this.unsavedWork) { + loadProfile (checkForUnsavedWork) { + if (checkForUnsavedWork && this.unsavedWork) { this.confirmSwitchProfileDialog = true } else { this.$http.get('/profiles/'.concat(this.selectedProfile.id)) @@ -736,7 +736,7 @@ export default { }).then(response => { if (response.status === 200) { this.getSamples() - this.loadProfile() + this.loadProfile(false) this.closeEditSampleForm() this.infoSnackbarText = 'Sample Saved' this.infoSnackbar = true @@ -866,7 +866,7 @@ export default { const recording = await this.recorder.stop() // Set active profile back to the selected one - this.loadProfile() + this.loadProfile(false) const url = URL.createObjectURL(recording) const anchor = document.createElement('a') @@ -890,7 +890,7 @@ export default { await this.recorder.stop() // Set active profile back to the selected one - this.loadProfile() + this.loadProfile(false) clearInterval(this.recordingInterval) this.recordingDialog = false @@ -898,7 +898,7 @@ export default { }, discardChanges () { this.unsavedWork = false - this.loadProfile() + this.loadProfile(true) this.confirmSwitchProfileDialog = false }, saveChanges () {