Make code cleaner

This commit is contained in:
Diego Sampaio 2017-08-22 10:49:37 -03:00
parent 43ab17d507
commit 860da9b0af
No known key found for this signature in database
GPG Key ID: E060152B30502562
6 changed files with 0 additions and 165 deletions

View File

@ -24,124 +24,3 @@ export function login() {
type: 'LOGIN'
};
}
// // GENRES
// export function retrieveMoviesGenresSuccess(res) {
// return {
// type: types.RETRIEVE_MOVIES_GENRES_SUCCESS,
// moviesGenres: res.data
// };
// }
// export function retrieveMoviesGenres() {
// return function (dispatch) {
// return axios.get(`${TMDB_URL}/genre/movie/list?api_key=${TMDB_API_KEY}`)
// .then(res => {
// dispatch(retrieveMoviesGenresSuccess(res));
// })
// .catch(error => {
// console.log(error); //eslint-disable-line
// });
// };
// }
// // POPULAR
// export function retrievePopularMoviesSuccess(res) {
// return {
// type: types.RETRIEVE_POPULAR_MOVIES_SUCCESS,
// popularMovies: res.data
// };
// }
// export function retrievePopularMovies(page) {
// return function (dispatch) {
// return axios.get(`${TMDB_URL}/movie/popular?api_key=${TMDB_API_KEY}&page=${page}`)
// .then(res => {
// dispatch(retrievePopularMoviesSuccess(res));
// })
// .catch(error => {
// console.log('Popular', error); //eslint-disable-line
// });
// };
// }
// // NOW PLAYING
// export function retrieveNowPlayingMoviesSuccess(res) {
// return {
// type: types.RETRIEVE_NOWPLAYING_MOVIES_SUCCESS,
// nowPlayingMovies: res.data
// };
// }
// export function retrieveNowPlayingMovies(page) {
// return function (dispatch) {
// return axios.get(`${TMDB_URL}/movie/now_playing?api_key=${TMDB_API_KEY}&page=${page}`)
// .then(res => {
// dispatch(retrieveNowPlayingMoviesSuccess(res));
// })
// .catch(error => {
// console.log('Now Playing', error); //eslint-disable-line
// });
// };
// }
// // MOVIES LIST
// export function retrieveMoviesListSuccess(res) {
// return {
// type: types.RETRIEVE_MOVIES_LIST_SUCCESS,
// list: res.data
// };
// }
// export function retrieveMoviesList(type, page) {
// return function (dispatch) {
// return axios.get(`${TMDB_URL}/movie/${type}?api_key=${TMDB_API_KEY}&page=${page}`)
// .then(res => {
// dispatch(retrieveMoviesListSuccess(res));
// })
// .catch(error => {
// console.log('Movies List', error); //eslint-disable-line
// });
// };
// }
// // SEARCH RESULTS
// export function retrieveMoviesSearchResultsSuccess(res) {
// return {
// type: types.RETRIEVE_MOVIES_SEARCH_RESULT_SUCCESS,
// searchResults: res.data
// };
// }
// export function retrieveMoviesSearchResults(query, page) {
// return function (dispatch) {
// return axios.get(`${TMDB_URL}/search/movie?api_key=${TMDB_API_KEY}&query=${query}&page=${page}`)
// .then(res => {
// dispatch(retrieveMoviesSearchResultsSuccess(res));
// })
// .catch(error => {
// console.log('Movies Search Results', error); //eslint-disable-line
// });
// };
// }
// // MOVIE DETAILS
// export function retrieveMovieDetailsSuccess(res) {
// return {
// type: types.RETRIEVE_MOVIE_DETAILS_SUCCESS,
// details: res.data
// };
// }
// export function retrieveMovieDetails(movieId) {
// return function (dispatch) {
// return axios.get(`${TMDB_URL}/movie/${movieId}?api_key=${TMDB_API_KEY}&append_to_response=casts,images,videos`)
// .then(res => {
// dispatch(retrieveMovieDetailsSuccess(res));
// })
// .catch(error => {
// console.log('Movie Details', error); //eslint-disable-line
// });
// };
// }

View File

@ -37,7 +37,6 @@ export default class MessageBox extends React.PureComponent {
}
submit(message) {
// console.log(this.state);
const text = message;
if (text.trim() === '') {
return;
@ -56,8 +55,6 @@ export default class MessageBox extends React.PureComponent {
};
ImagePicker.showImagePicker(options, (response) => {
// console.log('Response = ', response);
if (response.didCancel) {
console.log('User cancelled image picker');
} else if (response.error) {
@ -84,8 +81,6 @@ export default class MessageBox extends React.PureComponent {
<TextInput
ref={component => this.component = component}
style={styles.textBoxInput}
// value={this.state.text}
// onChangeText={text => this.setState({ text })}
returnKeyType='send'
onSubmitEditing={event => this.submit(event.nativeEvent.text)}
blurOnSubmit={false}

View File

@ -1,10 +1,2 @@
// export const RETRIEVE_MOVIES_GENRES_SUCCESS = 'RETRIEVE_MOVIES_GENRES_SUCCESS';
// export const RETRIEVE_POPULAR_MOVIES_SUCCESS = 'RETRIEVE_POPULAR_MOVIES_SUCCESS';
// export const RETRIEVE_NOWPLAYING_MOVIES_SUCCESS = 'RETRIEVE_NOWPLAYING_MOVIES_SUCCESS';
// export const RETRIEVE_MOVIES_LIST_SUCCESS = 'RETRIEVE_MOVIES_LIST_SUCCESS';
// export const RETRIEVE_MOVIE_DETAILS_SUCCESS = 'RETRIEVE_MOVIE_DETAILS_SUCCESS';
// export const RETRIEVE_MOVIES_SEARCH_RESULT_SUCCESS = 'RETRIEVE_MOVIES_SEARCH_RESULT_SUCCESS';
export const SET_CURRENT_SERVER = 'SET_CURRENT_SERVER';
export const SET_ALL_SETTINGS = 'SET_ALL_SETTINGS';

View File

@ -8,16 +8,6 @@ import ListServerView from './views/serverList';
import store from './lib/createStore';
//
// export const authenticated = (view) => {
// if (!store.getState().login.authenticated) {
// return store.getState().navigator.resetTo({
// screen: 'Login'
// });
// }
// return view;
// };
export const authenticated = WrappedComponent => class _p extends React.PureComponent {
constructor() {
super();
@ -36,12 +26,6 @@ export const authenticated = WrappedComponent => class _p extends React.PureComp
};
//
export class PublicScreen extends React.PureComponent {
// componentWillMount() {
// this.props.setNavigator(this.props.navigator);
// if (this.props.currentServer) {
// return this.props.navigator.navigate('private');
// }
// }
render() {
return !this.login.isAuthenticated || !this.login.user ? null : (<ListServerView {...this.props} />);
}
@ -52,20 +36,13 @@ export class PublicScreen extends React.PureComponent {
setNavigator: navigator => dispatch(setNavigator(navigator))
}))
export class PrivateScreen extends React.PureComponent {
componentWillMount() {
// this.props.setNavigator(this.props.navigator);
}
render() {
// if (this.props.logged) {
// return (<Text>oi</Text>);
// }
return (<LoginView {...this.props} />);
}
}
@connect(() => ({
// logged: state.login.isAuthenticated
}), dispatch => ({
// navigate: routeName => dispatch(NavigationActions.navigate({ routeName })),
setNavigator: navigator => dispatch(setNavigator(navigator))
}))
export const HomeScreen = class extends React.PureComponent {

View File

@ -33,7 +33,6 @@ const subscriptionSchema = {
name: 'string',
fname: { type: 'string', optional: true },
rid: 'string',
// u: { _id: 'hKCY2XGzHYk89SAaM', username: 'rodrigo', name: null },
open: { type: 'bool', optional: true },
alert: { type: 'bool', optional: true },
// roles: [ 'owner' ],

View File

@ -42,7 +42,6 @@ const RocketChat = {
const url = `${ _url }/websocket`;
Meteor.connect(url, { autoConnect: true, autoReconnect: true });
// , { autoConnect: false, autoReconnect: false }
Meteor.ddp.on('disconnected', () => {
reduxStore.dispatch(disconnect());
});
@ -50,9 +49,6 @@ const RocketChat = {
reduxStore.dispatch(connectSuccess());
resolve();
});
// Meteor.ddp.on('loggin', () => {
// reduxStore.dispatch(loginSuccess({}));
// });
Meteor.ddp.on('connected', () => {
Meteor.call('public-settings/get', (err, data) => {
if (err) {
@ -78,19 +74,16 @@ const RocketChat = {
});
Meteor.ddp.on('changed', (ddbMessage) => {
// console.log('changed', ddbMessage);
if (ddbMessage.collection === 'stream-room-messages') {
realm.write(() => {
const message = ddbMessage.fields.args[0];
message.temp = false;
message._server = { id: reduxStore.getState().server };
// write('messages', message);
realm.create('messages', message, true);
});
}
if (ddbMessage.collection === 'stream-notify-user') {
// console.log(ddbMessage);
realm.write(() => {
const data = ddbMessage.fields.args[1];
data._server = { id: reduxStore.getState().server };