Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance offline behavior #157

Merged
merged 1 commit into from Mar 15, 2017
Merged

feat: enhance offline behavior #157

merged 1 commit into from Mar 15, 2017

Conversation

enguerran
Copy link
Contributor

When a replication is complete AND when there is some new document(s), then
we refresh the current folder's file list by dispatching an action creator.

And on startup, we don't get localfile first as in that case we have to need the end of the replication to display files.
Instead we load remote files and start a repeated replication. When the first replication is going to start, it creates a local database.

It is related to cozy/cozy-client-js#109

I think it's better, what do you think?

@@ -22,7 +24,7 @@ export const initClient = (url, onRegister = null, device = 'Device') => {
console.log(`Cozy Client initializes a connection with ${url}`)
cozy.client.init({
cozyURL: url,
offline: {doctypes: ['io.cozy.files']},
// offline: {doctypes: ['io.cozy.files']},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes, yet another too early push.

if (result.docs_written !== 0) {
dispatch(openFolder(getState().folder.id))
}
console.log('replication complete', result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's normal to have left the log?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, I missed it... again! ;)

@kosssi
Copy link
Contributor

kosssi commented Mar 13, 2017

@enguerran can you rebase & upgrade cozy-client-js?

@enguerran
Copy link
Contributor Author

This branch is up-to-date, I need to double-check the behavior before a potential merge.

@enguerran
Copy link
Contributor Author

According to me, it works like a charm.

@enguerran
Copy link
Contributor Author

As soon as @kosssi validates the changes, I merge it.

@kosssi kosssi merged commit b3dd327 into cozy:master Mar 15, 2017
@enguerran enguerran deleted the better.offline branch March 15, 2017 12:59
goldoraf pushed a commit to goldoraf/cozy-drive that referenced this pull request Aug 21, 2017
fix: clear selection on view change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants