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
Conversation
mobile/src/lib/cozy-helper.js
Outdated
@@ -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']}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove it?
There was a problem hiding this comment.
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.
mobile/src/lib/cozy-helper.js
Outdated
if (result.docs_written !== 0) { | ||
dispatch(openFolder(getState().folder.id)) | ||
} | ||
console.log('replication complete', result) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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! ;)
@enguerran can you rebase & upgrade cozy-client-js? |
This branch is up-to-date, I need to double-check the behavior before a potential merge. |
According to me, it works like a charm. |
As soon as @kosssi validates the changes, I merge it. |
fix: clear selection on view change
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?