{"size": 1312, "ext": "js", "max_stars_repo_path": "client/main.js", "max_stars_repo_name": "fmilani/contatempo", "max_stars_repo_stars_event_min_datetime": "2017-05-15T10:57:42.000Z", "max_stars_repo_stars_event_max_datetime": "2017-10-07T18:54:42.000Z", "max_issues_repo_path": "client/main.js", "max_issues_repo_name": "joaoscalett/contatempo", "max_issues_repo_issues_event_min_datetime": "2016-12-21T14:18:33.000Z", "max_issues_repo_issues_event_max_datetime": "2019-09-24T15:51:46.000Z", "max_forks_repo_path": "client/main.js", "max_forks_repo_name": "joaoscalett/contatempo", "max_forks_repo_forks_event_min_datetime": "2019-09-23T01:35:21.000Z", "max_forks_repo_forks_event_max_datetime": "2019-09-23T01:35:21.000Z"}
{"max_stars_count": 3, "max_issues_count": 16, "max_forks_count": 1, "avg_line_length": 31.2380952381, "max_line_length": 80, "alphanum_fraction": 0.6570121951}
// client entry point, imports all client code
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import { i18n } from 'meteor/universe:i18n';
import moment from 'moment';
// FIXME: importing this moment locale is causing a warning on browser's console
// without this import, setting moment's locale doesn't work
import 'moment/locale/pt-br';
import injectTapEventPlugin from 'react-tap-event-plugin';
import renderRoutes from '../imports/startup/client/routes.jsx';

Meteor.startup(() => {
  injectTapEventPlugin();

  // for now, only pt-BR supported
  moment.updateLocale('pt-br', {
    calendar: {
      sameDay: '[Hoje]',
      nextDay: '[Amanhã]',
      nextWeek: 'ddd, DD [de] MMMM',
      lastDay: '[Ontem]',
      lastWeek: 'ddd, DD [de] MMMM',
      sameElse: 'ddd, DD [de] MMMM',
    },
  });
  i18n.setLocale('pt-BR');

  // subscribe to how many reports the user has sent
  Meteor.subscribe('user.reportsSentCounter');

  // wait for locale to be loaded to render the app
  i18n.onceChangeLocale(() => {
    Meteor.subscribe('user.settings', {
      // wait for user settings to be available. we need it to decide if we
      // redirect the user to settings page
      onReady() {
        render(renderRoutes(), document.getElementById('app'));
      },
    });
  });
});
