soiz1 commited on
Commit
c7b6157
·
verified ·
1 Parent(s): d347e38

Update src/lib/libraries/extension-tags.js

Browse files
Files changed (1) hide show
  1. src/lib/libraries/extension-tags.js +15 -1
src/lib/libraries/extension-tags.js CHANGED
@@ -1,5 +1,6 @@
1
  import messages from './tag-messages.js';
2
- export default [
 
3
  { tag: 'penguinmod', intlLabel: messages.penguinmod },
4
  { tag: 'turbowarp', intlLabel: messages.turbowarp },
5
  { tag: 'scratch', intlLabel: messages.scratch },
@@ -21,3 +22,16 @@ export default [
21
  library.select(''); // selects custom extension since it's id is ''
22
  } },
23
  ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import messages from './tag-messages.js';
2
+
3
+ const tags = [
4
  { tag: 'penguinmod', intlLabel: messages.penguinmod },
5
  { tag: 'turbowarp', intlLabel: messages.turbowarp },
6
  { tag: 'scratch', intlLabel: messages.scratch },
 
22
  library.select(''); // selects custom extension since it's id is ''
23
  } },
24
  ];
25
+
26
+ // ENV.CanLoadCustomExtensionがfalseなら、「divider1」と「custom」タグを除去
27
+ if (typeof ENV !== 'undefined' && ENV.CanLoadCustomExtension === false) {
28
+ // tagが 'divider1' かつ intlLabel が 'Actions' の要素と
29
+ // tagが 'custom' の要素を除外する
30
+ export default tags.filter(item => {
31
+ if (item.tag === 'divider1' && item.intlLabel === 'Actions') return false;
32
+ if (item.tag === 'custom') return false;
33
+ return true;
34
+ });
35
+ } else {
36
+ export default tags;
37
+ }