# All files / composer/file-uploads FileUploader.js

100% Statements 6/6
100% Branches 4/4
100% Functions 1/1
100% Lines 6/6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    5x
    5x
    5x
    5x
    5x
    5x

     import NotificationActionCreators from '../action-creators/NotificationActionCreators';
    import { NotificationScopes, MediaTypes } from '../AppConstants';

    export default class FileUploader {
      static throwMixedMediaTypesError(service) {
        let message = 'We can only attach one type of file at the same time: either ';
        message += service.maxAttachableImagesCount > 1 ? 'images' : 'an image';
        message += service.canHaveMediaAttachmentType(MediaTypes.GIF) ? ', or a gif,' : '';
        message += ' or a video.<br/>';
        message += 'Could you try with only one of those?';
        NotificationActionCreators.queueError({
          scope: NotificationScopes.FILE_UPLOAD,
          message,
        });
      }
    }