Skip to content

Comments

update offline state message when saving#2027

Merged
luka-nextcloud merged 1 commit intomasterfrom
fix/offline-state-issue
Jan 13, 2022
Merged

update offline state message when saving#2027
luka-nextcloud merged 1 commit intomasterfrom
fix/offline-state-issue

Conversation

@luka-nextcloud
Copy link
Contributor

Signed-off-by: Luka Trovic [email protected]

  • Resolves: #
    Offline state: "Offline, changes will be saved when online"

  • Target version: master

Summary

Add a status message for offline state.

},
lastSavedStatus() {
return this.dirtyStateIndicator ? t('text', 'Saving …') : t('text', 'Saved')
return this.hasConnectionIssue ? t('text', 'Offline, changes will be saved when online') : this.dirtyStateIndicator ? t('text', 'Saving …') : t('text', 'Saved')
Copy link
Member

Choose a reason for hiding this comment

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

Small suggest to improve readability of the code:

Suggested change
return this.hasConnectionIssue ? t('text', 'Offline, changes will be saved when online') : this.dirtyStateIndicator ? t('text', 'Saving …') : t('text', 'Saved')
if (this.hasConnectionIssue) {
return t('text', 'Connection lost. Will be saved once connection is restored.')
}
return this.dirtyStateIndicator ? t('text', 'Saving …') : t('text', 'Saved')

Otherwise good to go with the new wording from my side.

Copy link
Member

Choose a reason for hiding this comment

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

Now the logic to check for this.hasConnectionIssue is doubled, looks like that was accidently @luka-nextcloud 😬

@luka-nextcloud luka-nextcloud force-pushed the fix/offline-state-issue branch from fa4dd4e to 395f1d9 Compare December 27, 2021 07:39
@luka-nextcloud luka-nextcloud force-pushed the fix/offline-state-issue branch 2 times, most recently from 75478aa to b98c1ae Compare December 27, 2021 13:39
@luka-nextcloud
Copy link
Contributor Author

@mejo- Fixed :)

}
.connection-error:after {
visibility: visible;
content: 'Offline';
Copy link
Member

Choose a reason for hiding this comment

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

That won't work with translations unfortunately, but you can just return the translated text of Offline within the lastSavedStatus method by using the isMobile mixin

export default {

@juliusknorr juliusknorr added 2. developing bug Something isn't working labels Dec 28, 2021
@juliusknorr juliusknorr added this to the Nextcloud 24 milestone Dec 28, 2021
@luka-nextcloud luka-nextcloud force-pushed the fix/offline-state-issue branch from b98c1ae to 9868e29 Compare December 28, 2021 15:49
@julien-nc
Copy link
Member

@luka-nextcloud You might have launched npm install instead of npm ci and then you included package-lock.json. Could you remove those changes and force push to this branch?

IMO a simple way to do this would be:

# while being in your branch with a clean status
# this will cancel the last commit but keep the changes
git reset HEAD~
# then this will get rid of the changes to package-lock.json
git checkout package-lock.json
git commit -a -m "update offline state message when saving"
git push origin fix/offline-state-issue -f

@luka-nextcloud luka-nextcloud force-pushed the fix/offline-state-issue branch 2 times, most recently from b9b9f8c to 3460b41 Compare January 3, 2022 06:57
@mejo-
Copy link
Member

mejo- commented Jan 13, 2022

@luka-nextcloud I think your commit is missing the built javascript assets.

If you rebase the PR against master and then run npm ci && npm run build and commit the changes afterwards, it should be ready to be merged 😊

@luka-nextcloud
Copy link
Contributor Author

Hmm, it looks strange - let me check and try again.

@luka-nextcloud luka-nextcloud force-pushed the fix/offline-state-issue branch from 3460b41 to 90e54e4 Compare January 13, 2022 12:25
@luka-nextcloud luka-nextcloud merged commit cec776f into master Jan 13, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix/offline-state-issue branch January 13, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants