Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
yh_vendor
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
于良
9 years ago
Commit
8882b62f470e53d7fb4da31cf71969cf5282b3d6
1 parent
9b35ca75
取消用户数据随crash上传 review by yewanwan
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
js/containers/App.js
js/utils/errorHandler.js
js/containers/App.js
View file @
8882b62
...
...
@@ -64,18 +64,14 @@ function mapDispatchToProps(dispatch) {
class
App
extends
Component
{
componentDidMount
()
{
errorHandler
.
init
();
this
.
props
.
actions
.
getStoredUserInfo
();
this
.
props
.
actions
.
getGuideDisplayState
();
}
componentWillUnmount
()
{
let
userInfo
=
{
account
:
this
.
props
.
user
.
profile
.
account
,
pid
:
this
.
props
.
user
.
profile
.
pid
,
sessionKey
:
this
.
props
.
user
.
profile
.
sessionKey
,
};
errorHandler
.
init
(
userInfo
);
}
render
()
{
...
...
js/utils/errorHandler.js
View file @
8882b62
...
...
@@ -3,19 +3,19 @@
import
StackTrace
from
'stacktrace-js'
;
import
{
Crashlytics
}
from
'react-native-fabric'
;
function
init
(
userInfo
)
{
function
init
()
{
if
(
__DEV__
)
{
// Don't send exceptions from __DEV__, it's way too noisy!
// Live reloading and hot reloading in particular lead to tons of noise...
return
;
}
if
(
userInfo
)
{
let
{
account
,
pid
,
sessionKey
}
=
userInfo
;
Crashlytics
.
setUserName
(
account
||
'unknow'
);
Crashlytics
.
setString
(
pid
||
'unknow'
);
Crashlytics
.
setString
(
sessionKey
||
'unknow'
);
}
// if (userInfo) {
// let {account, pid, sessionKey} = userInfo;
// Crashlytics.setUserName(account || 'unknow');
// Crashlytics.setString(pid || 'unknow');
// Crashlytics.setString(sessionKey || 'unknow');
// }
let
originalHandler
=
global
.
ErrorUtils
.
getGlobalHandler
();
function
errorHandler
(
e
)
{
...
...
Please
register
or
login
to post a comment