Refactor Reconnect
This commit is contained in:
parent
64b2affee4
commit
8b0577b46f
1 changed files with 11 additions and 16 deletions
|
|
@ -1,19 +1,15 @@
|
||||||
/* eslint-disable react/jsx-indent-props */
|
/* eslint-disable react/jsx-indent-props */
|
||||||
/* eslint-disable import/no-absolute-path */
|
/* eslint-disable import/no-absolute-path */
|
||||||
|
|
||||||
import React, { Fragment, Component } from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { translate } from 'react-i18next';
|
import { translate } from 'react-i18next';
|
||||||
import { Meteor } from 'meteor/meteor';
|
import { Meteor } from 'meteor/meteor';
|
||||||
import { Tracker } from 'meteor/tracker';
|
import { Tracker } from 'meteor/tracker';
|
||||||
import Blaze from 'meteor/gadicc:blaze-react-component';
|
import Blaze from 'meteor/gadicc:blaze-react-component';
|
||||||
|
|
||||||
class Reconnect extends Component {
|
const Reconnect = ({ t, authenticated }) => (
|
||||||
render() {
|
<div>
|
||||||
const { t, authenticated } = this.props;
|
|
||||||
// console.log(`Reconnect ${!authenticated ? 'enabled' : 'disabled'}`);
|
|
||||||
return (
|
|
||||||
<Fragment>
|
|
||||||
{ !authenticated &&
|
{ !authenticated &&
|
||||||
<Blaze
|
<Blaze
|
||||||
template="meteorStatus"
|
template="meteorStatus"
|
||||||
|
|
@ -21,10 +17,8 @@ class Reconnect extends Component {
|
||||||
textConnecting={t('Desconectado del servidor, reconectando...')}
|
textConnecting={t('Desconectado del servidor, reconectando...')}
|
||||||
linkText={t('Reintentar ahora')}
|
linkText={t('Reintentar ahora')}
|
||||||
/> }
|
/> }
|
||||||
</Fragment>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Reconnect.propTypes = {
|
Reconnect.propTypes = {
|
||||||
t: PropTypes.func.isRequired,
|
t: PropTypes.func.isRequired,
|
||||||
|
|
@ -36,11 +30,12 @@ Reconnect.defaultProps = {
|
||||||
|
|
||||||
export default translate([], { wait: true })(Reconnect);
|
export default translate([], { wait: true })(Reconnect);
|
||||||
|
|
||||||
|
/*
|
||||||
if (!Meteor.isProduction) {
|
if (!Meteor.isProduction) {
|
||||||
// We clear the console on disconnect during development
|
// We clear the console on disconnect during development
|
||||||
Tracker.autorun(() => {
|
Tracker.autorun(() => {
|
||||||
if (Meteor.status().status === 'waiting') {
|
if (Meteor.status().status === 'waiting') {
|
||||||
// console.clear();
|
console.clear();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
} */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue