nodebb-plugin-composer-default 10.3.7 → 10.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/library.js +15 -15
  2. package/package.json +1 -1
package/library.js CHANGED
@@ -45,19 +45,20 @@ plugin.addAdminNavigation = async function (header) {
45
45
  };
46
46
 
47
47
  plugin.addPrefetchTags = async function (hookData) {
48
- const prefetch = [
49
- '/assets/src/modules/composer.js', '/assets/src/modules/composer/uploads.js', '/assets/src/modules/composer/drafts.js',
50
- '/assets/src/modules/composer/tags.js', '/assets/src/modules/composer/categoryList.js', '/assets/src/modules/composer/resize.js',
51
- '/assets/src/modules/composer/autocomplete.js', '/assets/templates/composer.tpl',
52
- `/assets/language/${meta.config.defaultLang || 'en-GB'}/topic.json`,
53
- `/assets/language/${meta.config.defaultLang || 'en-GB'}/modules.json`,
54
- `/assets/language/${meta.config.defaultLang || 'en-GB'}/tags.json`,
55
- ];
56
-
57
- hookData.links = hookData.links.concat(prefetch.map(path => ({
58
- rel: 'prefetch',
59
- href: `${nconf.get('relative_path') + path}?${meta.config['cache-buster']}`,
60
- })));
48
+ const { req } = hookData;
49
+ if (req.uid > 0) {
50
+ const prefetch = [
51
+ '/assets/templates/composer.js',
52
+ `/assets/language/${meta.config.defaultLang || 'en-GB'}/topic.json`,
53
+ `/assets/language/${meta.config.defaultLang || 'en-GB'}/modules.json`,
54
+ `/assets/language/${meta.config.defaultLang || 'en-GB'}/tags.json`,
55
+ ];
56
+
57
+ hookData.links = hookData.links.concat(prefetch.map(path => ({
58
+ rel: 'prefetch',
59
+ href: `${nconf.get('relative_path') + path}?${meta.config['cache-buster']}`,
60
+ })));
61
+ }
61
62
 
62
63
  return hookData;
63
64
  };
@@ -117,8 +118,7 @@ plugin.getFormattingOptions = async function () {
117
118
  };
118
119
 
119
120
  plugin.filterComposerBuild = async function (hookData) {
120
- const { req } = hookData;
121
- const { res } = hookData;
121
+ const { req, res } = hookData;
122
122
 
123
123
  if (req.query.p) {
124
124
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "10.3.7",
3
+ "version": "10.3.9",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {