Onboarding updates #197

Merged
neb-b merged 6 commits from onboarding into master 2019-09-23 16:23:39 +02:00
neb-b commented 2019-09-09 20:58:34 +02:00 (Migrated from github.com)

Changes

  • myChannelClaims now defaults to undefined. This is helpful to know if we've fetched a users channel claims or not. undefined === not fetched, null === fetched and no channels
  • I added a sync file here. I'm not sure if it belongs here but I think it makes sense to handle the data (after it's been fetched by some service) to populate our reducers in lbry-redux. If everything is in lbryinc we need to either import a constant from lbryinc into lbry-redux or just hard-code the ACTIONS.POPULATE_USER_SETTINGS action.
#### Changes - `myChannelClaims` now defaults to `undefined`. This is helpful to know if we've fetched a users channel claims or not. `undefined` === not fetched, `null` === fetched and no channels - I added a `sync` file here. I'm not sure if it belongs here but I think it makes sense to handle the data (after it's been fetched by some service) to populate our reducers in `lbry-redux`. If everything is in `lbryinc` we need to either import a constant from `lbryinc` into `lbry-redux` or just hard-code the `ACTIONS.POPULATE_USER_SETTINGS` action.
kauffj (Migrated from github.com) reviewed 2019-09-13 23:23:02 +02:00
kauffj (Migrated from github.com) commented 2019-09-13 23:19:01 +02:00

replace settings with shared user state, shared state, or something else

replace settings with shared user state, shared state, or something else
kauffj (Migrated from github.com) commented 2019-09-13 23:19:15 +02:00

why undefined though?

why undefined though?
kauffj (Migrated from github.com) commented 2019-09-13 23:19:57 +02:00

if Sets have issues, just make it an object and use the keys, it's basically the same thing

if Sets have issues, just make it an object and use the keys, it's basically the same thing
@ -68,0 +74,4 @@
...state,
followedTags: tags && tags.length ? tags : DEFAULT_FOLLOWED_TAGS,
};
},
kauffj (Migrated from github.com) commented 2019-09-13 23:21:12 +02:00

when receiving saved/stored user state, I think it's probably fine (and possible better) to overwrite than to try to merge

...I may be misunderstanding what this function is doing

when receiving saved/stored user state, I think it's probably fine (and possible better) to overwrite than to try to merge ...I may be misunderstanding what this function is doing
kauffj (Migrated from github.com) commented 2019-09-13 23:22:10 +02:00

this should probably be return [];

this should probably be `return []`;
neb-b (Migrated from github.com) reviewed 2019-09-20 17:18:20 +02:00
neb-b (Migrated from github.com) commented 2019-09-20 17:18:20 +02:00

So we can track if we've fetched a users channels. If it's undefined, we haven't fetched them yet.

So we can track if we've fetched a users channels. If it's undefined, we haven't fetched them yet.
neb-b (Migrated from github.com) reviewed 2019-09-20 17:18:49 +02:00
neb-b (Migrated from github.com) commented 2019-09-20 17:18:49 +02:00

It's returning undefined so we can check in the app if we've ever fetched before.

It's returning undefined so we can check in the app if we've ever fetched before.
akinwale commented 2019-09-23 09:34:46 +02:00 (Migrated from github.com)

@seanyesmunt I merged the latest commit with the master branch in order to get the changes that I merged from the channel-creator branch in. If this causes any problems, please feel free to revert. Thanks.

@seanyesmunt I merged the latest commit with the master branch in order to get the changes that I merged from the `channel-creator` branch in. If this causes any problems, please feel free to revert. Thanks.
akinwale (Migrated from github.com) reviewed 2019-09-23 09:39:57 +02:00
akinwale (Migrated from github.com) commented 2019-09-23 09:39:36 +02:00

For this, I don't think we should override with DEFAULT_FOLLOWED_TAGS if no tags are returned by the remote saved state. That may override the local state if the user has made any changes, or in cases where the shared state may have ended up out of sync.

For this, I don't think we should override with `DEFAULT_FOLLOWED_TAGS` if no tags are returned by the remote saved state. That may override the local state if the user has made any changes, or in cases where the shared state may have ended up out of sync.
akinwale (Migrated from github.com) reviewed 2019-09-23 10:18:04 +02:00
@ -0,0 +10,4 @@
};
function extractUserState(rawObj: v0Data) {
if (rawObj && rawObj.version === '0.1' && rawObj.shared) {
akinwale (Migrated from github.com) commented 2019-09-23 10:18:04 +02:00

Should we be checking for version here? That means we'll probably have to update this with every new version, but I suppose it's not too big of a deal since we'll eventually transition to sync using the wallet servers.

Should we be checking for version here? That means we'll probably have to update this with every new version, but I suppose it's not too big of a deal since we'll eventually transition to sync using the wallet servers.
neb-b (Migrated from github.com) reviewed 2019-09-23 15:24:57 +02:00
@ -0,0 +10,4 @@
};
function extractUserState(rawObj: v0Data) {
if (rawObj && rawObj.version === '0.1' && rawObj.shared) {
neb-b (Migrated from github.com) commented 2019-09-23 15:24:56 +02:00

I think so. With new versions we would have to update anyway since that would probably mean changing the shape of persisted object.

I think so. With new versions we would have to update anyway since that would probably mean changing the shape of persisted object.
neb-b (Migrated from github.com) reviewed 2019-09-23 15:27:12 +02:00
neb-b (Migrated from github.com) commented 2019-09-23 15:27:12 +02:00

Maybe
if (!followedTags && !tags) return DEFAULT_FOLLOWED)TAGS
else return tags
?

Maybe `if (!followedTags && !tags) return DEFAULT_FOLLOWED)TAGS` `else return tags` ?
neb-b commented 2019-09-23 16:18:54 +02:00 (Migrated from github.com)

@akinwale I'm going to merge this just so it's easier to work with. We can continue to make changes to it.

@akinwale I'm going to merge this just so it's easier to work with. We can continue to make changes to it.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-redux#197
No description provided.