Fix lint problems

This commit is contained in:
Klaus 2017-07-07 08:17:49 -03:00
parent 4c1c7ad65a
commit 8ef23a559e
3 changed files with 5 additions and 14 deletions

View File

@ -1,14 +1,9 @@
import _ from 'lodash';
import Captions from '/imports/api/2.0/captions';
import { check } from 'meteor/check';
import { inReplyToHTML5Client } from '/imports/api/common/server/helpers';
import addCaption from '../modifiers/addCaption';
export default function handleCaptionHistory({ body }, meetingId) {
if (!inReplyToHTML5Client({ body })) {
return;
}
const SERVER_CONFIG = Meteor.settings.app;
const CAPTION_CHUNK_LENGTH = SERVER_CONFIG.captionsChunkLength || 1000;
@ -45,11 +40,11 @@ export default function handleCaptionHistory({ body }, meetingId) {
Captions.remove(selectorToRemove);
chunks.forEach((captions, index) => {
chunks.forEach((chunkCaptions, index) => {
const captionHistoryObject = {
locale,
ownerId,
captions,
chunkCaptions,
index,
next: (index < chunks.length - 1) ? index + 1 : undefined,
};

View File

@ -34,14 +34,12 @@ export default function handleCaptionOwnerUpdate({ body }, meetingId) {
return addCaption(meetingId, locale, captionHistory);
}
const cb = (err, numChanged) => {
const cb = (err) => {
if (err) {
return Logger.error(`Updating captions owner: ${err}`);
}
if (numChanged) {
return Logger.verbose(`Update caption owner locale=${locale} meeting=${meetingId}`);
}
return Logger.verbose(`Update caption owner locale=${locale} meeting=${meetingId}`);
};
return Captions.update(selector, modifier, { multi: true }, cb);

View File

@ -40,9 +40,7 @@ export default function addCaption(meetingId, locale, captionHistory, id = false
return Logger.verbose(`Added caption2x locale=${locale} meeting=${meetingId}`);
}
if (numChanged) {
return Logger.verbose(`Upserted caption2x locale=${locale} meeting=${meetingId}`);
}
return Logger.verbose(`Upserted caption2x locale=${locale} meeting=${meetingId}`);
};
return Captions.upsert(selector, modifier, cb);