mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 09:31:43 -05:00
More small fixes
This commit is contained in:
parent
e544b0ce0b
commit
9d27f386c9
3 changed files with 12 additions and 8 deletions
|
@ -6,6 +6,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"start": "meteor --settings settings.json",
|
||||
"visualizer": "meteor --extra-packages bundle-visualizer --production --settings settings.json",
|
||||
"lint": "eslint --cache --ext .jsx,js packages",
|
||||
"test-unit": "TEST_WATCH=1 meteor test-packages ./packages/* --port 3002 --driver-package meteortesting:mocha --raw-logs",
|
||||
"test": "npm run test-unit",
|
||||
|
|
|
@ -117,14 +117,17 @@ class Upload extends PureComponent {
|
|||
const self = this;
|
||||
|
||||
// add callback to clean any preview or error values
|
||||
// (when handling multiple images)
|
||||
function uploadKeepRealImages(data) {
|
||||
// keep only "real" images
|
||||
const images = self.getImages({
|
||||
includePreviews: false,
|
||||
includeDeleted: false,
|
||||
});
|
||||
// replace images in `data` object with real images
|
||||
set(data, self.props.path, images);
|
||||
if (Array.isArray(self.props.value)) {
|
||||
// keep only "real" images
|
||||
const images = self.getImages({
|
||||
includePreviews: false,
|
||||
includeDeleted: false,
|
||||
});
|
||||
// replace images in `data` object with real images
|
||||
set(data, self.props.path, images);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
context.addToSubmitForm(uploadKeepRealImages);
|
||||
|
|
|
@ -48,7 +48,7 @@ Users.getUserNameById = function (userId) {return Users.getUserName(Users.findOn
|
|||
* @param {Object} user
|
||||
*/
|
||||
Users.getDisplayName = function (user) {
|
||||
if (typeof user === 'undefined') {
|
||||
if (!user) {
|
||||
return '';
|
||||
} else {
|
||||
return (user.displayName) ? user.displayName : Users.getUserName(user);
|
||||
|
|
Loading…
Add table
Reference in a new issue