Przeglądaj źródła

* Fix bug of group selector ReactComponent renderer.

Tatsuya Ise 8 lat temu
rodzic
commit
b7add8c5b8
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      resource/js/app.js

+ 4 - 4
resource/js/app.js

@@ -190,11 +190,11 @@ function updatePageGrantElems(newPageGrant) {
   pageGrantGroupElem.value = newPageGrant.grantGroup.userGroupId || '';
   pageGrantGroupElem.value = newPageGrant.grantGroup.userGroupId || '';
 }
 }
 if (pageEditorGrantSelectorElem) {
 if (pageEditorGrantSelectorElem) {
-  let userRelatedGroups = [];
+  let userRelatedGroups;
   if (userRelatedGroupsElem != null) {
   if (userRelatedGroupsElem != null) {
-    let userRelatedGroupsJSON = JSON.parse(userRelatedGroupsElem.textContent || '{}')
-    if (userRelatedGroupsJSON != null && userRelatedGroupsJSON.length > 0) {
-      userRelatedGroups = userRelatedGroupsJSON.map((value) => {
+    let userRelatedGroupsJSONString = userRelatedGroupsElem.textContent;
+    if (userRelatedGroupsJSONString != null && userRelatedGroupsJSONString.length > 0) {
+      userRelatedGroups = JSON.parse(userRelatedGroupsJSONString || '{}', (value) => {
         return new UserGroup(value);
         return new UserGroup(value);
       });
       });
     }
     }