Remove publicFlag from room creation form in MultiChatDialog: Simplify visibility handling by directly using the visibility state to determine public/private status, enhancing clarity and reducing redundancy.
This commit is contained in:
@@ -75,14 +75,6 @@
|
|||||||
<option value="private">private</option>
|
<option value="private">private</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
|
||||||
public=true|false
|
|
||||||
<select v-model="roomCreateForm.publicFlag">
|
|
||||||
<option value="">(keine)</option>
|
|
||||||
<option value="true">true</option>
|
|
||||||
<option value="false">false</option>
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
<label>
|
<label>
|
||||||
gender
|
gender
|
||||||
<select v-model="roomCreateForm.gender">
|
<select v-model="roomCreateForm.gender">
|
||||||
@@ -283,7 +275,6 @@ export default {
|
|||||||
roomCreateForm: {
|
roomCreateForm: {
|
||||||
roomName: '',
|
roomName: '',
|
||||||
visibility: '',
|
visibility: '',
|
||||||
publicFlag: '',
|
|
||||||
gender: '',
|
gender: '',
|
||||||
minAge: null,
|
minAge: null,
|
||||||
maxAge: null,
|
maxAge: null,
|
||||||
@@ -348,7 +339,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
roomName: '',
|
roomName: '',
|
||||||
visibility: '',
|
visibility: '',
|
||||||
publicFlag: '',
|
|
||||||
gender: '',
|
gender: '',
|
||||||
minAge: null,
|
minAge: null,
|
||||||
maxAge: null,
|
maxAge: null,
|
||||||
@@ -379,9 +369,10 @@ export default {
|
|||||||
const name = (this.roomCreateForm.roomName || '').trim();
|
const name = (this.roomCreateForm.roomName || '').trim();
|
||||||
if (!name) return '';
|
if (!name) return '';
|
||||||
const parts = ['/cr', name];
|
const parts = ['/cr', name];
|
||||||
if (this.roomCreateForm.visibility) parts.push(this.roomCreateForm.visibility);
|
if (this.roomCreateForm.visibility === 'public') {
|
||||||
if (this.roomCreateForm.publicFlag === 'true' || this.roomCreateForm.publicFlag === 'false') {
|
parts.push('public', 'public=true');
|
||||||
parts.push(`public=${this.roomCreateForm.publicFlag}`);
|
} else if (this.roomCreateForm.visibility === 'private') {
|
||||||
|
parts.push('private', 'public=false');
|
||||||
}
|
}
|
||||||
if (this.roomCreateForm.gender) parts.push(`gender=${this.roomCreateForm.gender}`);
|
if (this.roomCreateForm.gender) parts.push(`gender=${this.roomCreateForm.gender}`);
|
||||||
const minAge = this.parseOptionalInteger(this.roomCreateForm.minAge);
|
const minAge = this.parseOptionalInteger(this.roomCreateForm.minAge);
|
||||||
|
|||||||
Reference in New Issue
Block a user