Improve logic for unsharing shared task [SCI-10097] (#7026)

This commit is contained in:
wandji 2024-02-05 10:18:56 +01:00 committed by GitHub
parent e85f48d51f
commit 5bdfc41f94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,8 +34,8 @@
class="sci-toggle-checkbox"
:disabled="!canShare"
tabindex="0"
@change="checkboxChange"
@keyup.enter="handleCheckboxEnter"/>
@click.prevent="checkboxChange"
@keyup.enter="checkboxChange"/>
<span class="sci-toggle-checkbox-label"></span>
</span>
</div>
@ -199,12 +199,8 @@ export default {
this.characterCount = this.$refs.textarea.value.length;
});
},
handleCheckboxEnter() {
this.sharedEnabled = !this.sharedEnabled;
this.checkboxChange();
},
checkboxChange() {
if (this.sharedEnabled) {
if (!this.sharedEnabled) {
$.post(this.shareableLinkUrl, { description: this.description }, (result) => {
this.shareableData = result.data;
this.$emit('enable');
@ -224,6 +220,7 @@ export default {
this.shareableData = {};
this.description = '';
this.dirty = false;
this.sharedEnabled = false;
this.$emit('disable');
this.$emit('close');