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