Skip to content

[NEW] Delete server#1302

Closed
CalebeRios wants to merge 5 commits intoRocketChat:developfrom
djorkaeffalexandre:feature.remove_server
Closed

[NEW] Delete server#1302
CalebeRios wants to merge 5 commits intoRocketChat:developfrom
djorkaeffalexandre:feature.remove_server

Conversation

@CalebeRios
Copy link
Contributor

Fix function to delete server

Translate messages of alert for brazilian portugues and english

Co-authored-by: Bruno Dantas oliveiradantas96@gmail.com

@RocketChat/ReactNative

Closes #1087

ezgif com-video-to-gif

@djorkaeffalexandre
Copy link
Contributor

djorkaeffalexandre commented Oct 11, 2019

I think is better if you remove all data about this server when delete it on ServerDropdown.. like the database, RNUserDefaults info and the serverRecord on serversDB.

@djorkaeffalexandre djorkaeffalexandre changed the title Delete server from database on Dropdown [IMPROVEMENT] Delete server on Dropdown Oct 12, 2019
Copy link
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

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

@CalebeRios I've fixed unnecessary changes, warnings and an if condition on this PR.
Can you fix the delete method?

On RocketChat.logout, we have this delete steps implemented already: https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/app/lib/rocketchat.js#L342
You could move part of the logic to a new method called removeServer and call it on logout and on ServerDropdown.

@diegolmello diegolmello changed the title [IMPROVEMENT] Delete server on Dropdown [NEW] Add delete server option Oct 28, 2019
@diegolmello diegolmello changed the title [NEW] Add delete server option [NEW] Delete server Oct 28, 2019
@CalebeRios
Copy link
Contributor Author

Thanks for changes @diegolmello. I will see the changes you made and finish that issue. My problem is to delete the database, because in logout we delete the active database, and I need get the database of another server. Can you give me a light?

@diegolmello
Copy link
Member

@CalebeRios Ok.
You should do something similar to setActiveDB, but without changing the current state.
Think in something like getDB, that runs a similar logic to as setActiveDB but it doesn't change this.databases.activeDB.
https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/app/lib/database/index.js#L54

From there, you can receive a database obj and run an action to reset it.

CalebeRios and others added 4 commits November 14, 2019 16:36
Co-authored-by: Bruno Dantas <oliveiradantas96@gmail.com>

Fix function to delete server

Co-authored-by: Bruno Dantas <oliveiradantas96@gmail.com>

Translate messages of alert for brazilian portugues and english

Co-authored-by: Bruno Dantas <oliveiradantas96@gmail.com>
… database of server

Separates responsibilities of functions
@CalebeRios
Copy link
Contributor Author

@djorkaeffalexandre @diegolmello I made the changes you request. Sorry for the delay.

@djorkaeffalexandre
Copy link
Contributor

It'll be closed by #1975 .
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove server directly from server's list

3 participants