Commit b59a65b6 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'fix/user-session-save' into 'master'

Fix saving user data on first load

See merge request !288
parents bbc248bb 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'],
]);
......
......@@ -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],
]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment