no-mixed-spaces-and-tabs (#95)

I wonder why I can't see the diffs from my vscode 🤔
This commit is contained in:
Bobby Wibowo 2018-04-26 13:48:44 +07:00 committed by Crawl
parent 9d17bb284a
commit fa6c33e2e9
3 changed files with 27 additions and 27 deletions

View File

@ -17,7 +17,7 @@ const storage = multer.diskStorage({
destination: function(req, file, cb) { destination: function(req, file, cb) {
cb(null, uploadDir); cb(null, uploadDir);
}, },
filename: function(req, file, cb) { filename: function(req, file, cb) {
const access = i => { const access = i => {
const name = randomstring.generate(config.uploads.fileLength) + path.extname(file.originalname); const name = randomstring.generate(config.uploads.fileLength) + path.extname(file.originalname);
fs.access(path.join(uploadDir, name), err => { fs.access(path.join(uploadDir, name), err => {

View File

@ -337,7 +337,7 @@ panel.getAlbums = function(){
panel.renameAlbum = function(id){ panel.renameAlbum = function(id){
swal({ swal({
title: "Rename album", title: "Rename album",
text: "New name you want to give the album:", text: "New name you want to give the album:",
type: "input", type: "input",
showCancelButton: true, showCancelButton: true,
@ -345,13 +345,13 @@ panel.renameAlbum = function(id){
animation: "slide-from-top", animation: "slide-from-top",
inputPlaceholder: "My super album" inputPlaceholder: "My super album"
},function(inputValue){ },function(inputValue){
if (inputValue === false) return false; if (inputValue === false) return false;
if (inputValue === "") { if (inputValue === "") {
swal.showInputError("You need to write something!"); swal.showInputError("You need to write something!");
return false return false
} }
axios.post('/api/albums/rename', { axios.post('/api/albums/rename', {
id: id, id: id,
name: inputValue name: inputValue
}) })

View File

@ -9,15 +9,15 @@ upload.myDropzone;
upload.checkIfPublic = function(){ upload.checkIfPublic = function(){
axios.get('/api/check') axios.get('/api/check')
.then(function (response) { .then(function (response) {
upload.isPrivate= response.data.private; upload.isPrivate= response.data.private;
upload.maxFileSize = response.data.maxFileSize; upload.maxFileSize = response.data.maxFileSize;
upload.preparePage(); upload.preparePage();
}) })
.catch(function (error) { .catch(function (error) {
swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error");
return console.log(error); return console.log(error);
}); });
} }
upload.preparePage = function(){ upload.preparePage = function(){
@ -33,10 +33,10 @@ upload.verifyToken = function(token, reloadOnError){
axios.post('/api/tokens/verify', { axios.post('/api/tokens/verify', {
token: token token: token
}) })
.then(function (response) { .then(function (response) {
if(response.data.success === false){ if(response.data.success === false){
swal({ swal({
title: "An error ocurred", title: "An error ocurred",
text: response.data.description, text: response.data.description,
type: "error" type: "error"
@ -47,17 +47,17 @@ upload.verifyToken = function(token, reloadOnError){
} }
}) })
return; return;
} }
localStorage.token = token; localStorage.token = token;
upload.token = token; upload.token = token;
return upload.prepareUpload(); return upload.prepareUpload();
}) })
.catch(function (error) { .catch(function (error) {
swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error");
return console.log(error); return console.log(error);
}); });
} }
@ -129,7 +129,7 @@ upload.prepareDropzone = function(){
maxFiles: 1000, maxFiles: 1000,
autoProcessQueue: true, autoProcessQueue: true,
headers: { headers: {
'token': upload.token 'token': upload.token
}, },
init: function() { init: function() {
upload.myDropzone = this; upload.myDropzone = this;