Преглед на файлове

Fix broken /login endpoint

Penar Musaraj преди 4 години
родител
ревизия
04d29231ea
променени са 2 файла, в които са добавени 22 реда и са изтрити 21 реда
  1. 21 20
      assets/javascripts/discourse/initializers/bbb.js.es6
  2. 1 1
      config/locales/client.en.yml

+ 21 - 20
assets/javascripts/discourse/initializers/bbb.js.es6

@@ -83,28 +83,29 @@ export default {
         id: "discourse-bbb",
       });
 
-      if (siteSettings.bbb_staff_only && !currentUser.staff) {
-        return;
-      }
-
-      api.modifyClass("controller:composer", {
-        actions: {
-          insertBBBModal() {
-            showModal("insert-bbb").setProperties({
-              toolbarEvent: this.get("toolbarEvent"),
-            });
+      if (
+        !siteSettings.bbb_staff_only ||
+        (siteSettings.bbb_staff_only && currentUser && currentUser.staff)
+      ) {
+        api.modifyClass("controller:composer", {
+          actions: {
+            insertBBBModal() {
+              showModal("insert-bbb").setProperties({
+                toolbarEvent: this.get("toolbarEvent"),
+              });
+            },
           },
-        },
-      });
+        });
 
-      api.addToolbarPopupMenuOptionsCallback((controller) => {
-        return {
-          id: "insert-bbb",
-          icon: "video",
-          action: "insertBBBModal",
-          label: "bbb.composer_title",
-        };
-      });
+        api.addToolbarPopupMenuOptionsCallback((controller) => {
+          return {
+            id: "insert-bbb",
+            icon: "video",
+            action: "insertBBBModal",
+            label: "bbb.composer_title",
+          };
+        });
+      }
     });
   },
 };

+ 1 - 1
config/locales/client.en.yml

@@ -1,7 +1,7 @@
 en:
   js:
     bbb:
-      composer_title: Add BigBlueButton room
+      composer_title: Add BigBlueButton
       meetingID: Meeting ID
       button_text: Button label (optional)
       attendeePW: Attendee password