-
Notifications
You must be signed in to change notification settings - Fork 890
feat: preserve the last selected account between runs #9061
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: preserve the last selected account between runs #9061
Conversation
|
Sorry, it seems I've borked my github setup (haven't used github in a long time). |
i2h3
left a comment
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.
Does someone know if it is possible to remove the merge commit with the github cli (gh)?
I do not know about gh but in Git it would be an git rebase --interactive on master in which the merge commit is just dropped then. 🤔
2e8a4db to
1de5dd4
Compare
Was overthinking it a bit 😅 |
|
@Aiiaiiio Seems you have been reviewing the previous attempt at implementing this thingy. Could you take a look at this one as well if you have some time? |
1de5dd4 to
70be1f0
Compare
|
Not entirely sure what is wrong with the SonarCloud check. If someone could clarify whether the issue is on my side, I'd be grateful 👍 |
mgallien
left a comment
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.
@DmySyz can you solve the conflicts ?
sorry that you have to do it
6592632 to
70be1f0
Compare
No worries. Should be ok now |
3b71687 to
70be1f0
Compare
Aiiaiiio
left a comment
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.
Looks awesome! See my change request please. We can discuss if you disagree.
Still broken unfortunately. "Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to" |
Head branch was pushed to by a user without write access
37b05a7 to
70be1f0
Compare
c5d7ce3 to
70be1f0
Compare
70be1f0 to
5a2a9fb
Compare
|
@Aiiaiiio sorry for dragging this thing on, but I think this version is the cleanest solution for now. |
Aiiaiiio
left a comment
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.
I like it! Thank you!
0dfabf9 to
5a2a9fb
Compare
Added an extra setting in the config that contains an account id to store the last one selected Modified usermodel logic to auto select the account using the id from the config Modified the account manager and user model to init user list after account restoration completes Signed-off-by: Dmytro Syzov <[email protected]>
037fcf7 to
fb9fd94
Compare
Signed-off-by: dsyzov <[email protected]>
|
Artifact containing the AppImage: nextcloud-appimage-pr-9061.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
Description
Implements #8986 and #9035
This PR implements the feature to remember and restore the last selected account after the client restarts. Previously, the client would always select the first account on startup, which was frustrating for users with multiple accounts.
Changes Made
ConfigFile (
src/libsync/configfile.handconfigfile.cpp):lastSelectedAccountCconstant for the settings keylastSelectedAccount()getter methodsetLastSelectedAccount()setter methodUserModel (
src/gui/tray/usermodel.cpp):buildUserList()to restore the last selected account on startupsetCurrentUserId()to save the account id when user changes accountsHow It Works
buildUserList()attempts to restore the last selected accountTechnical Details
Testing
The fix has been manually tested. Unit test has not been added as an appropriate existing test for the relevant component was not found and creating it was deemed out of scope for this PR.
Screenshots
feat_preserve_acc.mp4
Notes
As account IDs are not randomly generated it is possible that a wrong account will be selected if somehow the original one was deleted and another one was created in its place outside the client.