mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-11 19:06:20 +00:00
Fix unwanted display of unsaved work dialog
This commit is contained in:
@@ -50,7 +50,7 @@
|
|||||||
label="Profiles"
|
label="Profiles"
|
||||||
class="mx-3 mb-5"
|
class="mx-3 mb-5"
|
||||||
:disabled="playDisabled"
|
:disabled="playDisabled"
|
||||||
@change="loadProfile"
|
@change="loadProfile(true)"
|
||||||
/>
|
/>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.exportedProfile = this.profileItems[0]
|
this.exportedProfile = this.profileItems[0]
|
||||||
this.recordedProfile = this.profileItems[0]
|
this.recordedProfile = this.profileItems[0]
|
||||||
this.loadProfile()
|
this.loadProfile(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -420,8 +420,8 @@ export default {
|
|||||||
this.errorSnackbar = true
|
this.errorSnackbar = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loadProfile () {
|
loadProfile (checkForUnsavedWork) {
|
||||||
if (this.unsavedWork) {
|
if (checkForUnsavedWork && this.unsavedWork) {
|
||||||
this.confirmSwitchProfileDialog = true
|
this.confirmSwitchProfileDialog = true
|
||||||
} else {
|
} else {
|
||||||
this.$http.get('/profiles/'.concat(this.selectedProfile.id))
|
this.$http.get('/profiles/'.concat(this.selectedProfile.id))
|
||||||
@@ -736,7 +736,7 @@ export default {
|
|||||||
}).then(response => {
|
}).then(response => {
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
this.getSamples()
|
this.getSamples()
|
||||||
this.loadProfile()
|
this.loadProfile(false)
|
||||||
this.closeEditSampleForm()
|
this.closeEditSampleForm()
|
||||||
this.infoSnackbarText = 'Sample Saved'
|
this.infoSnackbarText = 'Sample Saved'
|
||||||
this.infoSnackbar = true
|
this.infoSnackbar = true
|
||||||
@@ -866,7 +866,7 @@ export default {
|
|||||||
const recording = await this.recorder.stop()
|
const recording = await this.recorder.stop()
|
||||||
|
|
||||||
// Set active profile back to the selected one
|
// Set active profile back to the selected one
|
||||||
this.loadProfile()
|
this.loadProfile(false)
|
||||||
|
|
||||||
const url = URL.createObjectURL(recording)
|
const url = URL.createObjectURL(recording)
|
||||||
const anchor = document.createElement('a')
|
const anchor = document.createElement('a')
|
||||||
@@ -890,7 +890,7 @@ export default {
|
|||||||
await this.recorder.stop()
|
await this.recorder.stop()
|
||||||
|
|
||||||
// Set active profile back to the selected one
|
// Set active profile back to the selected one
|
||||||
this.loadProfile()
|
this.loadProfile(false)
|
||||||
|
|
||||||
clearInterval(this.recordingInterval)
|
clearInterval(this.recordingInterval)
|
||||||
this.recordingDialog = false
|
this.recordingDialog = false
|
||||||
@@ -898,7 +898,7 @@ export default {
|
|||||||
},
|
},
|
||||||
discardChanges () {
|
discardChanges () {
|
||||||
this.unsavedWork = false
|
this.unsavedWork = false
|
||||||
this.loadProfile()
|
this.loadProfile(true)
|
||||||
this.confirmSwitchProfileDialog = false
|
this.confirmSwitchProfileDialog = false
|
||||||
},
|
},
|
||||||
saveChanges () {
|
saveChanges () {
|
||||||
|
|||||||
Reference in New Issue
Block a user