From 68d33159997fe976c47b4a6ae6cb6d96059cc8b4 Mon Sep 17 00:00:00 2001
From: Thomas Citharel <tcit@tcit.fr>
Date: Fri, 30 Jul 2021 17:40:41 +0200
Subject: [PATCH] Fix event editing joinMode

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
---
 js/src/views/Event/Edit.vue | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/js/src/views/Event/Edit.vue b/js/src/views/Event/Edit.vue
index 47fd35874..941a27117 100644
--- a/js/src/views/Event/Edit.vue
+++ b/js/src/views/Event/Edit.vue
@@ -584,8 +584,6 @@ export default class EditEvent extends Vue {
 
   EventVisibility = EventVisibility;
 
-  needsApproval = false;
-
   canPromote = true;
 
   limitedPlaces = false;
@@ -949,9 +947,12 @@ export default class EditEvent extends Vue {
     }
   }
 
-  @Watch("needsApproval")
-  updateEventJoinOptions(needsApproval: boolean): void {
-    if (needsApproval === true) {
+  get needsApproval(): boolean {
+    return this.event?.joinOptions == EventJoinOptions.RESTRICTED;
+  }
+
+  set needsApproval(value: boolean) {
+    if (value === true) {
       this.event.joinOptions = EventJoinOptions.RESTRICTED;
     } else {
       this.event.joinOptions = EventJoinOptions.FREE;