Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
e97ef462
Verified
Commit
e97ef462
authored
Jun 14, 2019
by
Sébastiaan Versteeg
Browse files
Fix saving user data on first load
parent
2ad3873d
Changes
2
Hide whitespace changes
Inline
Side-by-side
__tests__/sagas/session.spec.js
View file @
e97ef462
...
...
@@ -166,7 +166,7 @@ describe('session saga', () => {
.
silentRun
()
.
then
(()
=>
{
expect
(
AsyncStorage
.
multiSet
).
toBeCalledWith
([
[
IDENTIFIERKEY
,
12
],
[
IDENTIFIERKEY
,
'
12
'
],
[
DISPLAYNAMEKEY
,
'
Johnny Test
'
],
[
PHOTOKEY
,
'
http://example.org/photo.png
'
],
]);
...
...
app/sagas/session.js
View file @
e97ef462
...
...
@@ -35,7 +35,7 @@ function* init() {
]);
const
values
=
result
.
reduce
(
pairsToObject
,
{});
const
id
=
values
[
IDENTIFIERKEY
];
const
id
=
parseInt
(
values
[
IDENTIFIERKEY
]
,
0
)
;
const
username
=
values
[
USERNAMEKEY
];
const
token
=
values
[
TOKENKEY
];
const
displayName
=
values
[
DISPLAYNAMEKEY
];
...
...
@@ -130,7 +130,7 @@ function* userInfo() {
const
userProfile
=
yield
call
(
apiRequest
,
'
members/me
'
,
data
);
yield
call
(
AsyncStorage
.
multiSet
,
[
[
IDENTIFIERKEY
,
userProfile
.
pk
],
[
IDENTIFIERKEY
,
userProfile
.
pk
.
toString
()
],
[
DISPLAYNAMEKEY
,
userProfile
.
display_name
],
[
PHOTOKEY
,
userProfile
.
avatar
.
medium
],
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment