[FIX] Analytics error events (#930)
This commit is contained in:
parent
9e4a4d2454
commit
a148e6d15d
|
@ -308,7 +308,7 @@ export default class MessageActions extends React.Component {
|
||||||
await RocketChat.reportMessage(actionMessage._id);
|
await RocketChat.reportMessage(actionMessage._id);
|
||||||
Alert.alert(I18n.t('Message_Reported'));
|
Alert.alert(I18n.t('Message_Reported'));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log('report message', err);
|
log('err_report_message', err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,7 @@ class MessageBox extends Component {
|
||||||
try {
|
try {
|
||||||
database.create('users', user, true);
|
database.create('users', user, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('create users', e);
|
log('err_create_users', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -414,7 +414,7 @@ class MessageBox extends Component {
|
||||||
try {
|
try {
|
||||||
await RocketChat.sendFileMessage(rid, fileInfo, tmid);
|
await RocketChat.sendFileMessage(rid, fileInfo, tmid);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('sendImageMessage', e);
|
log('err_send_image', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ class MessageBox extends Component {
|
||||||
const image = await ImagePicker.openCamera(imagePickerConfig);
|
const image = await ImagePicker.openCamera(imagePickerConfig);
|
||||||
this.showUploadModal(image);
|
this.showUploadModal(image);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('takePhoto', e);
|
log('err_take_photo', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ class MessageBox extends Component {
|
||||||
const image = await ImagePicker.openPicker(imagePickerConfig);
|
const image = await ImagePicker.openPicker(imagePickerConfig);
|
||||||
this.showUploadModal(image);
|
this.showUploadModal(image);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('chooseFromLibrary', e);
|
log('err_choose_from_library', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ class MessageBox extends Component {
|
||||||
if (e && e.error === 'error-file-too-large') {
|
if (e && e.error === 'error-file-too-large') {
|
||||||
return Alert.alert(I18n.t(e.error));
|
return Alert.alert(I18n.t(e.error));
|
||||||
}
|
}
|
||||||
log('finishAudioMessage', e);
|
log('err_finish_audio_message', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ export default async function() {
|
||||||
database.delete(emojiRecord);
|
database.delete(emojiRecord);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getEmojis delete', e);
|
log('err_get_emojis_delete', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,6 @@ export default async function() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getCustomEmojis', e);
|
log('err_get_custom_emojis', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ const create = (permissions) => {
|
||||||
try {
|
try {
|
||||||
database.create('permissions', permission, true);
|
database.create('permissions', permission, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getPermissions create', e);
|
log('err_get_permissions_create', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ export default async function() {
|
||||||
database.delete(permission);
|
database.delete(permission);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getPermissions delete', e);
|
log('err_get_permissions_delete', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,6 @@ export default async function() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getPermissions', e);
|
log('err_get_permissions', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,12 +20,12 @@ export default async function() {
|
||||||
try {
|
try {
|
||||||
database.create('roles', role, true);
|
database.create('roles', role, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getRoles create', e);
|
log('err_get_roles_create', e);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getRoles', e);
|
log('err_get_roles', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ function updateServer(param) {
|
||||||
try {
|
try {
|
||||||
database.databases.serversDB.create('servers', { id: reduxStore.getState().server.server, ...param }, true);
|
database.databases.serversDB.create('servers', { id: reduxStore.getState().server.server, ...param }, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('updateServer', e);
|
log('err_get_settings_update_server', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ export default async function() {
|
||||||
try {
|
try {
|
||||||
database.create('settings', { ...setting, _updatedAt: new Date() }, true);
|
database.create('settings', { ...setting, _updatedAt: new Date() }, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('create settings', e);
|
log('err_get_settings_create', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setting._id === 'Site_Name') {
|
if (setting._id === 'Site_Name') {
|
||||||
|
@ -52,6 +52,6 @@ export default async function() {
|
||||||
updateServer.call(this, { iconURL });
|
updateServer.call(this, { iconURL });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getSettings', e);
|
log('err_get_settings', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ export default function loadMessagesForRoom(...args) {
|
||||||
database.create('threadMessages', message, true);
|
database.create('threadMessages', message, true);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('loadMessagesForRoom -> create messages', e);
|
log('err_load_messages_for_room_create', e);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
return resolve(data);
|
return resolve(data);
|
||||||
|
@ -61,7 +61,7 @@ export default function loadMessagesForRoom(...args) {
|
||||||
return resolve([]);
|
return resolve([]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('loadMessagesForRoom', e);
|
log('err_load_messages_for_room', e);
|
||||||
reject(e);
|
reject(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,7 +45,7 @@ export default function loadMissedMessages(...args) {
|
||||||
database.create('threadMessages', message, true);
|
database.create('threadMessages', message, true);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('loadMissedMessages -> create messages', e);
|
log('err_load_missed_messages_create', e);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
@ -65,14 +65,14 @@ export default function loadMissedMessages(...args) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('loadMissedMessages -> delete message', e);
|
log('err_load_missed_messages_delete', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolve();
|
resolve();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('loadMissedMessages', e);
|
log('err_load_missed_messages', e);
|
||||||
reject(e);
|
reject(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default function loadThreadMessages({ tmid, offset = 0 }) {
|
||||||
message.rid = tmid;
|
message.rid = tmid;
|
||||||
database.create('threadMessages', message, true);
|
database.create('threadMessages', message, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('loadThreadMessages -> create messages', e);
|
log('err_load_thread_messages_create', e);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
return resolve(data);
|
return resolve(data);
|
||||||
|
@ -43,7 +43,7 @@ export default function loadThreadMessages({ tmid, offset = 0 }) {
|
||||||
return resolve([]);
|
return resolve([]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('loadThreadMessages', e);
|
log('err_load_thread_messages', e);
|
||||||
reject(e);
|
reject(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,6 +18,6 @@ export default async function readMessages(rid) {
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('readMessages', e);
|
log('err_read_messages', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ export async function sendFileMessage(rid, fileInfo, tmid) {
|
||||||
try {
|
try {
|
||||||
database.create('uploads', fileInfo, true);
|
database.create('uploads', fileInfo, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return log('sendFileMessage -> create uploads 1', e);
|
return log('err_send_file_message_create_upload_1', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ export async function sendFileMessage(rid, fileInfo, tmid) {
|
||||||
try {
|
try {
|
||||||
database.create('uploads', fileInfo, true);
|
database.create('uploads', fileInfo, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return log('sendFileMessage -> create uploads 2', e);
|
return log('err_send_file_message_create_upload_2', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -95,7 +95,7 @@ export async function sendFileMessage(rid, fileInfo, tmid) {
|
||||||
try {
|
try {
|
||||||
database.delete(upload);
|
database.delete(upload);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('sendFileMessage -> delete uploads', e);
|
log('err_send_file_message_delete_upload', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -104,7 +104,7 @@ export async function sendFileMessage(rid, fileInfo, tmid) {
|
||||||
try {
|
try {
|
||||||
database.create('uploads', fileInfo, true);
|
database.create('uploads', fileInfo, true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log('sendFileMessage -> create uploads 3', err);
|
log('err_send_file_message_create_upload_3', err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,6 @@ export default async function(rid, msg, tmid) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('sendMessage', e);
|
log('err_send_message', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ export default function subscribeRoom({ rid }) {
|
||||||
typingTimeouts[username] = null;
|
typingTimeouts[username] = null;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('TCL: removeUserTyping -> error', error);
|
log('err_remove_user_typing', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ export default function subscribeRoom({ rid }) {
|
||||||
removeUserTyping(username);
|
removeUserTyping(username);
|
||||||
}, 10000);
|
}, 10000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('TCL: addUserTyping -> error', error);
|
log('err_add_user_typing', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -198,7 +198,7 @@ export default function subscribeRoom({ rid }) {
|
||||||
try {
|
try {
|
||||||
promises = this.sdk.subscribeRoom(rid);
|
promises = this.sdk.subscribeRoom(rid);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('subscribeRoom', e);
|
log('err_subscribe_room', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default async function subscribeRooms() {
|
||||||
database.delete(subscription);
|
database.delete(subscription);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleStreamMessageReceived -> subscriptions removed', e);
|
log('err_stream_msg_received_sub_removed', e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const rooms = database.objects('rooms').filtered('_id == $0', data.rid);
|
const rooms = database.objects('rooms').filtered('_id == $0', data.rid);
|
||||||
|
@ -70,7 +70,7 @@ export default async function subscribeRooms() {
|
||||||
database.delete(rooms);
|
database.delete(rooms);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleStreamMessageReceived -> subscriptions updated', e);
|
log('err_stream_msg_received_sub_updated', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ export default async function subscribeRooms() {
|
||||||
database.create('subscriptions', tmp, true);
|
database.create('subscriptions', tmp, true);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleStreamMessageReceived -> rooms updated', e);
|
log('err_stream_msg_received_room_updated', e);
|
||||||
}
|
}
|
||||||
} else if (type === 'inserted') {
|
} else if (type === 'inserted') {
|
||||||
try {
|
try {
|
||||||
|
@ -91,7 +91,7 @@ export default async function subscribeRooms() {
|
||||||
database.create('rooms', data, true);
|
database.create('rooms', data, true);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleStreamMessageReceived -> rooms inserted', e);
|
log('err_stream_msg_received_room_inserted', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ export default async function subscribeRooms() {
|
||||||
database.create('messages', message, true);
|
database.create('messages', message, true);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleStreamMessageReceived -> message', e);
|
log('err_stream_msg_received_message', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ export default async function subscribeRooms() {
|
||||||
try {
|
try {
|
||||||
await this.sdk.subscribeNotifyUser();
|
await this.sdk.subscribeNotifyUser();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('subscribeRooms', e);
|
log('err_subscribe_rooms', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -96,7 +96,7 @@ const RocketChat = {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getServerInfo', e);
|
log('err_get_server_info', e);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
|
@ -387,7 +387,7 @@ const RocketChat = {
|
||||||
database.create('messages', message, true);
|
database.create('messages', message, true);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('resendMessage error', e);
|
log('err_resend_message', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -514,7 +514,7 @@ const RocketChat = {
|
||||||
try {
|
try {
|
||||||
room = await RocketChat.getRoom(message.rid);
|
room = await RocketChat.getRoom(message.rid);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Rocketchat.getPermalink', e);
|
log('err_get_permalink', e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const { server } = reduxStore.getState().server;
|
const { server } = reduxStore.getState().server;
|
||||||
|
|
|
@ -38,7 +38,7 @@ const restore = function* restore() {
|
||||||
|
|
||||||
yield put(actions.appReady({}));
|
yield put(actions.appReady({}));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('restore', e);
|
log('err_restore', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ const handleLogout = function* handleLogout() {
|
||||||
yield put(appStart('outside'));
|
yield put(appStart('outside'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
yield put(appStart('outside'));
|
yield put(appStart('outside'));
|
||||||
log('handleLogout', e);
|
log('err_handle_logout', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -77,7 +77,7 @@ const handleReplyBroadcast = function* handleReplyBroadcast({ message }) {
|
||||||
yield delay(500);
|
yield delay(500);
|
||||||
yield put(replyInit(message, false));
|
yield put(replyInit(message, false));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleReplyBroadcast', e);
|
log('err_reply_broadcast', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ const watchUserTyping = function* watchUserTyping({ rid, status }) {
|
||||||
yield RocketChat.emitTyping(rid, false);
|
yield RocketChat.emitTyping(rid, false);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('watchUserTyping', e);
|
log('err_watch_user_typing', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ const handleRoomsRequest = function* handleRoomsRequest() {
|
||||||
try {
|
try {
|
||||||
database.create('subscriptions', subscription, true);
|
database.create('subscriptions', subscription, true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log('handleRoomsRequest create sub', error);
|
log('err_rooms_request_create_sub', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -31,14 +31,14 @@ const handleRoomsRequest = function* handleRoomsRequest() {
|
||||||
try {
|
try {
|
||||||
database.databases.serversDB.create('servers', { id: server, roomsUpdatedAt: newRoomsUpdatedAt }, true);
|
database.databases.serversDB.create('servers', { id: server, roomsUpdatedAt: newRoomsUpdatedAt }, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleRoomsRequest update roomsUpdatedAt', e);
|
log('err_rooms_request_update', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
yield put(roomsSuccess());
|
yield put(roomsSuccess());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
yield put(roomsFailure(e));
|
yield put(roomsFailure(e));
|
||||||
log('handleRoomsRequest', e);
|
log('err_rooms_request', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ const getServerInfo = function* getServerInfo({ server }) {
|
||||||
|
|
||||||
return serverInfo;
|
return serverInfo;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getServerInfo', e);
|
log('err_get_server_info', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ const handleSelectServer = function* handleSelectServer({ server, version, fetch
|
||||||
|
|
||||||
yield put(selectServerSuccess(server, fetchVersion ? serverInfo && serverInfo.version : version));
|
yield put(selectServerSuccess(server, fetchVersion ? serverInfo && serverInfo.version : version));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleSelectServer', e);
|
log('err_select_server', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ const handleServerRequest = function* handleServerRequest({ server }) {
|
||||||
yield put(selectServerRequest(server, serverInfo.version, false));
|
yield put(selectServerRequest(server, serverInfo.version, false));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
yield put(serverFailure());
|
yield put(serverFailure());
|
||||||
log('handleServerRequest', e);
|
log('err_server_request', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { FOREGROUND, BACKGROUND } from 'redux-enhancer-react-native-appstate';
|
||||||
|
|
||||||
import RocketChat from '../lib/rocketchat';
|
import RocketChat from '../lib/rocketchat';
|
||||||
import { setBadgeCount } from '../push';
|
import { setBadgeCount } from '../push';
|
||||||
|
import log from '../utils/log';
|
||||||
|
|
||||||
const appHasComeBackToForeground = function* appHasComeBackToForeground() {
|
const appHasComeBackToForeground = function* appHasComeBackToForeground() {
|
||||||
const appRoot = yield select(state => state.app.root);
|
const appRoot = yield select(state => state.app.root);
|
||||||
|
@ -17,7 +18,7 @@ const appHasComeBackToForeground = function* appHasComeBackToForeground() {
|
||||||
setBadgeCount();
|
setBadgeCount();
|
||||||
return yield RocketChat.setUserPresenceOnline();
|
return yield RocketChat.setUserPresenceOnline();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('appHasComeBackToForeground', e);
|
log('err_app_has_come_back_to_foreground', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ const appHasComeBackToBackground = function* appHasComeBackToBackground() {
|
||||||
try {
|
try {
|
||||||
return yield RocketChat.setUserPresenceAway();
|
return yield RocketChat.setUserPresenceAway();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('appHasComeBackToBackground', e);
|
log('err_app_has_come_back_to_background', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class EventEmitter {
|
||||||
try {
|
try {
|
||||||
listener.apply(this, args);
|
listener.apply(this, args);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('EventEmitter.emit', e);
|
log('err_emit', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ export default class ProfileView extends React.Component {
|
||||||
const result = await RocketChat.getAvatarSuggestion();
|
const result = await RocketChat.getAvatarSuggestion();
|
||||||
this.setState({ avatarSuggestions: result });
|
this.setState({ avatarSuggestions: result });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('getAvatarSuggestion', e);
|
log('err_get_avatar_suggestion', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ export default class ProfileView extends React.Component {
|
||||||
return showErrorAlert(e.data.error);
|
return showErrorAlert(e.data.error);
|
||||||
}
|
}
|
||||||
showErrorAlert(I18n.t('There_was_an_error_while_action', { action: I18n.t(action) }));
|
showErrorAlert(I18n.t('There_was_an_error_while_action', { action: I18n.t(action) }));
|
||||||
log(func, e);
|
// log(func, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
submit = async() => {
|
submit = async() => {
|
||||||
|
|
|
@ -73,7 +73,7 @@ export default class RoomActionsView extends React.Component {
|
||||||
this.setState({ room: { ...result.channel, rid: result.channel._id } });
|
this.setState({ room: { ...result.channel, rid: result.channel._id } });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('RoomActionsView -> getChannelInfo -> error', error);
|
log('err_get_channel_info', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ export default class RoomActionsView extends React.Component {
|
||||||
this.setState({ membersCount: counters.members, joined: counters.joined });
|
this.setState({ membersCount: counters.members, joined: counters.joined });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('RoomActionsView -> getRoomCounters -> error', error);
|
log('err_get_room_counters', error);
|
||||||
}
|
}
|
||||||
} else if (room.t === 'd') {
|
} else if (room.t === 'd') {
|
||||||
this.updateRoomMember();
|
this.updateRoomMember();
|
||||||
|
@ -335,7 +335,7 @@ export default class RoomActionsView extends React.Component {
|
||||||
this.setState({ member: result.user });
|
this.setState({ member: result.user });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('RoomActions updateRoomMember', e);
|
log('err_update_room_member', e);
|
||||||
this.setState({ member: {} });
|
this.setState({ member: {} });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,7 @@ export default class RoomActionsView extends React.Component {
|
||||||
try {
|
try {
|
||||||
RocketChat.toggleBlockUser(rid, member._id, !blocker);
|
RocketChat.toggleBlockUser(rid, member._id, !blocker);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('toggleBlockUser', e);
|
log('err_toggle_block_user', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ export default class RoomActionsView extends React.Component {
|
||||||
};
|
};
|
||||||
RocketChat.saveNotificationSettings(room.rid, notifications);
|
RocketChat.saveNotificationSettings(room.rid, notifications);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('toggleNotifications', e);
|
log('err_toggle_notifications', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ export default class RoomInfoEditView extends React.Component {
|
||||||
this.setState({ nameError: e });
|
this.setState({ nameError: e });
|
||||||
}
|
}
|
||||||
error = true;
|
error = true;
|
||||||
log('saveRoomSettings', e);
|
log('err_save_room_settings', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.setState({ saving: false });
|
await this.setState({ saving: false });
|
||||||
|
@ -262,7 +262,7 @@ export default class RoomInfoEditView extends React.Component {
|
||||||
try {
|
try {
|
||||||
await RocketChat.toggleArchiveRoom(rid, t, !archived);
|
await RocketChat.toggleArchiveRoom(rid, t, !archived);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('toggleArchive', e);
|
log('err_toggle_archive', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ export default class RoomInfoView extends React.Component {
|
||||||
this.setState({ roomUser: result.user });
|
this.setState({ roomUser: result.user });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log('RoomInfoView.getUserInfo', error);
|
log('err_get_user_info', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ export default class RoomMembersView extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('onPressUser', e);
|
log('err_on_press_user', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ export default class RoomMembersView extends React.Component {
|
||||||
this.fetchMembers();
|
this.fetchMembers();
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('RoomMembers.toggleStatus', e);
|
log('err_toggle_status', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ export default class RoomMembersView extends React.Component {
|
||||||
});
|
});
|
||||||
navigation.setParams({ allUsers });
|
navigation.setParams({ allUsers });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('TCL: fetchMembers -> error', error);
|
log('err_fetch_members, error');
|
||||||
this.setState({ isLoading: false });
|
this.setState({ isLoading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ export default class RoomMembersView extends React.Component {
|
||||||
await RocketChat.toggleMuteUserInRoom(rid, userLongPressed.username, !userLongPressed.muted);
|
await RocketChat.toggleMuteUserInRoom(rid, userLongPressed.username, !userLongPressed.muted);
|
||||||
this.toast.show(I18n.t('User_has_been_key', { key: userLongPressed.muted ? I18n.t('unmuted') : I18n.t('muted') }));
|
this.toast.show(I18n.t('User_has_been_key', { key: userLongPressed.muted ? I18n.t('unmuted') : I18n.t('muted') }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('handleMute', e);
|
log('err_handle_mute', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ export class List extends React.PureComponent {
|
||||||
this.setState({ end: result.length < 50, loading: false });
|
this.setState({ end: result.length < 50, loading: false });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.setState({ loading: false });
|
this.setState({ loading: false });
|
||||||
log('ListView.onEndReached', e);
|
log('err_list_view_on_end_reached', e);
|
||||||
}
|
}
|
||||||
}, 300)
|
}, 300)
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ export default class UploadProgress extends Component {
|
||||||
try {
|
try {
|
||||||
database.write(() => database.delete(uploadItem[0]));
|
database.write(() => database.delete(uploadItem[0]));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('UploadProgess.deleteUpload', e);
|
log('err_upload_progress_delete', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ export default class UploadProgress extends Component {
|
||||||
try {
|
try {
|
||||||
await RocketChat.cancelUpload(item.path);
|
await RocketChat.cancelUpload(item.path);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('UploadProgess.cancelUpload', e);
|
log('err_upload_progress_cancel', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ export default class UploadProgress extends Component {
|
||||||
});
|
});
|
||||||
await RocketChat.sendFileMessage(rid, item);
|
await RocketChat.sendFileMessage(rid, item);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('UploadProgess.tryAgain', e);
|
log('err_upload_progress_try_again', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,8 +298,7 @@ export default class RoomView extends React.Component {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('TCL: init -> e', e);
|
log('err_room_init', e);
|
||||||
log('RoomView.init', e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +324,7 @@ export default class RoomView extends React.Component {
|
||||||
}
|
}
|
||||||
RocketChat.setReaction(shortname, messageId);
|
RocketChat.setReaction(shortname, messageId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('RoomView.onReactionPress', e);
|
log('err_room_on_reaction_press', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -420,8 +419,7 @@ export default class RoomView extends React.Component {
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('TCL: getMessages -> e', e);
|
log('err_get_messages', e);
|
||||||
log('getMessages', e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,8 +427,7 @@ export default class RoomView extends React.Component {
|
||||||
try {
|
try {
|
||||||
return RocketChat.loadThreadMessages({ tmid: this.tmid });
|
return RocketChat.loadThreadMessages({ tmid: this.tmid });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('TCL: getThreadMessages -> e', e);
|
log('err_get_thread_messages', e);
|
||||||
log('getThreadMessages', e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,7 +442,7 @@ export default class RoomView extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('joinRoom', e);
|
log('err_join_room', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -486,7 +483,7 @@ export default class RoomView extends React.Component {
|
||||||
database.create('threads', buildMessage(EJSON.fromJSONValue(thread)), true);
|
database.create('threads', buildMessage(EJSON.fromJSONValue(thread)), true);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('TCL: fetchThreadName -> error', error);
|
log('err_fetch_thread_name', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,8 +492,7 @@ export default class RoomView extends React.Component {
|
||||||
await RocketChat.toggleFollowMessage(this.tmid, !isFollowingThread);
|
await RocketChat.toggleFollowMessage(this.tmid, !isFollowingThread);
|
||||||
this.toast.show(isFollowingThread ? 'Unfollowed thread' : 'Following thread');
|
this.toast.show(isFollowingThread ? 'Unfollowed thread' : 'Following thread');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('TCL: RightButtonsContainer -> toggleFollowThread -> e', e);
|
log('err_toggle_follow_thread', e);
|
||||||
log('toggleFollowThread', e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ export default class Sort extends PureComponent {
|
||||||
setSortPreference(param);
|
setSortPreference(param);
|
||||||
RocketChat.saveSortPreference(param);
|
RocketChat.saveSortPreference(param);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('RoomsListView.setSortPreference', e);
|
log('err_set_sort_preference', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -360,7 +360,7 @@ export default class RoomsListView extends React.Component {
|
||||||
return this.goRoom({ rid: result.room._id, name: username, t: 'd' });
|
return this.goRoom({ rid: result.room._id, name: username, t: 'd' });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('RoomsListView._onPressItem', e);
|
log('err_on_press_item', e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return this.goRoom(item);
|
return this.goRoom(item);
|
||||||
|
|
|
@ -15,6 +15,7 @@ import Message from '../../containers/message/Message';
|
||||||
import scrollPersistTaps from '../../utils/scrollPersistTaps';
|
import scrollPersistTaps from '../../utils/scrollPersistTaps';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import StatusBar from '../../containers/StatusBar';
|
import StatusBar from '../../containers/StatusBar';
|
||||||
|
import log from '../../utils/log';
|
||||||
|
|
||||||
@connect(state => ({
|
@connect(state => ({
|
||||||
baseUrl: state.settings.Site_Url || state.server ? state.server.server : '',
|
baseUrl: state.settings.Site_Url || state.server ? state.server.server : '',
|
||||||
|
@ -81,7 +82,7 @@ export default class SearchMessagesView extends React.Component {
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.setState({ loading: false });
|
this.setState({ loading: false });
|
||||||
console.log('SearchMessagesView -> search -> catch -> error', error);
|
log('err_search_messages', error);
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ export default class SelectedUsersView extends React.Component {
|
||||||
await RocketChat.addUsersToRoom(rid);
|
await RocketChat.addUsersToRoom(rid);
|
||||||
navigation.pop();
|
navigation.pop();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('RoomActions Add User', e);
|
log('err_add_user', e);
|
||||||
} finally {
|
} finally {
|
||||||
setLoadingInvite(false);
|
setLoadingInvite(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import scrollPersistTaps from '../utils/scrollPersistTaps';
|
||||||
import I18n from '../i18n';
|
import I18n from '../i18n';
|
||||||
import RocketChat from '../lib/rocketchat';
|
import RocketChat from '../lib/rocketchat';
|
||||||
import StatusBar from '../containers/StatusBar';
|
import StatusBar from '../containers/StatusBar';
|
||||||
|
import log from '../utils/log';
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
loginTitle: {
|
loginTitle: {
|
||||||
|
@ -97,7 +98,7 @@ export default class SetUsernameView extends React.Component {
|
||||||
await RocketChat.setUsername(username);
|
await RocketChat.setUsername(username);
|
||||||
await loginRequest({ resume: token });
|
await loginRequest({ resume: token });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('SetUsernameView -> catch -> e', e);
|
log('err_submit_username', e);
|
||||||
}
|
}
|
||||||
this.setState({ saving: false });
|
this.setState({ saving: false });
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,7 @@ export default class SettingsView extends React.Component {
|
||||||
this.setState({ saving: false });
|
this.setState({ saving: false });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showErrorAlert(I18n.t('There_was_an_error_while_action', { action: I18n.t('saving_preferences') }));
|
showErrorAlert(I18n.t('There_was_an_error_while_action', { action: I18n.t('saving_preferences') }));
|
||||||
log('saveUserPreferences', e);
|
log('err_save_user_preferences', e);
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ export default class Sidebar extends Component {
|
||||||
try {
|
try {
|
||||||
RocketChat.setUserPresenceDefaultStatus(item.id);
|
RocketChat.setUserPresenceDefaultStatus(item.id);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('setUserPresenceDefaultStatus', e);
|
log('err_set_user_presence_default_status', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -115,7 +115,7 @@ export default class ThreadMessagesView extends React.Component {
|
||||||
try {
|
try {
|
||||||
database.create('threads', buildMessage(message), true);
|
database.create('threads', buildMessage(message), true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('ThreadMessagesView -> load -> create', e);
|
log('err_thread_messages_create', e);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ export default class ThreadMessagesView extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('ThreadMessagesView -> load -> error', error);
|
log('err_thread_messages_load', error);
|
||||||
this.setState({ loading: false, end: true });
|
this.setState({ loading: false, end: true });
|
||||||
}
|
}
|
||||||
}, 300)
|
}, 300)
|
||||||
|
@ -148,7 +148,7 @@ export default class ThreadMessagesView extends React.Component {
|
||||||
try {
|
try {
|
||||||
database.create('threads', buildMessage(message), true);
|
database.create('threads', buildMessage(message), true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('ThreadMessagesView -> sync -> update', e);
|
log('err_thread_messages_update', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ export default class ThreadMessagesView extends React.Component {
|
||||||
try {
|
try {
|
||||||
database.delete(oldMessage);
|
database.delete(oldMessage);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('ThreadMessagesView -> sync -> delete', e);
|
log('err_thread_messages_delete', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -173,7 +173,7 @@ export default class ThreadMessagesView extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('ThreadMessagesView -> sync -> error', error);
|
log('err_thread_messages_sync', error);
|
||||||
this.setState({ loading: false });
|
this.setState({ loading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,6 +99,16 @@
|
||||||
ReferencedContainer = "container:RocketChatRN.xcodeproj">
|
ReferencedContainer = "container:RocketChatRN.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
|
<CommandLineArguments>
|
||||||
|
<CommandLineArgument
|
||||||
|
argument = "-FIRDebugDisabled"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</CommandLineArgument>
|
||||||
|
<CommandLineArgument
|
||||||
|
argument = "-FIRDebugEnabled"
|
||||||
|
isEnabled = "NO">
|
||||||
|
</CommandLineArgument>
|
||||||
|
</CommandLineArguments>
|
||||||
<EnvironmentVariables>
|
<EnvironmentVariables>
|
||||||
<EnvironmentVariable
|
<EnvironmentVariable
|
||||||
key = "OS_ACTIVITY_MODE"
|
key = "OS_ACTIVITY_MODE"
|
||||||
|
|
Loading…
Reference in New Issue