Просмотр исходного кода

* Fix bug of group selector ReactComponent renderer.

Tatsuya Ise 7 лет назад
Родитель
Сommit
b7add8c5b8
1 измененных файлов с 4 добавлено и 4 удалено
  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 || '';
 }
 if (pageEditorGrantSelectorElem) {
-  let userRelatedGroups = [];
+  let userRelatedGroups;
   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);
       });
     }