mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
if imgur client id is not set but local file uploads are enabled use that
This commit is contained in:
@@ -94,9 +94,8 @@ define(['taskbar'], function(taskbar) {
|
||||
|
||||
var postContainer = $(composerTemplate[0]);
|
||||
|
||||
if(config.imgurClientIDSet) {
|
||||
if(config.allowFileUploads || config.imgurClientIDSet)
|
||||
initializeFileReader(post_uuid);
|
||||
}
|
||||
|
||||
var postData = composer.posts[post_uuid],
|
||||
titleEl = postContainer.find('.title'),
|
||||
|
||||
10
src/posts.js
10
src/posts.js
@@ -360,10 +360,7 @@ var db = require('./database'),
|
||||
|
||||
Posts.uploadPostImage = function(image, callback) {
|
||||
|
||||
if(!meta.config.imgurClientID) {
|
||||
return callback('imgurClientID not set', null);
|
||||
}
|
||||
|
||||
if(meta.config.imgurClientID) {
|
||||
if(!image) {
|
||||
return callback('invalid image', null);
|
||||
}
|
||||
@@ -378,6 +375,11 @@ var db = require('./database'),
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (meta.config.allowFileUploads) {
|
||||
Posts.uploadPostFile(image, callback);
|
||||
} else {
|
||||
callback('Uploads are disabled!');
|
||||
}
|
||||
}
|
||||
|
||||
Posts.uploadPostFile = function(file, callback) {
|
||||
|
||||
Reference in New Issue
Block a user