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

Server Icon doesn't load on Reconnect #5605

Open
Shaik-Sirajuddin opened this issue Mar 6, 2024 · 1 comment · May be fixed by #5608
Open

Server Icon doesn't load on Reconnect #5605

Shaik-Sirajuddin opened this issue Mar 6, 2024 · 1 comment · May be fixed by #5608

Comments

@Shaik-Sirajuddin
Copy link

Description:

After clicking on "Connect" in main page , the user is directed to Workspace View where the Workspace Details ( Icon , Name , URL ) are shown.
Now If the users clicks back and clicks on connect again , the Icon doesn't show up in Workspace View.

Environment Information:

  • Rocket.Chat Server Version: 6.7.0
  • Rocket.Chat App Version: 4.46.1.57002
  • Device Name: Samsung S22+
  • OS Version: Android V 14

Steps to reproduce:

1.Clean Install App
2.Go to initial page where user can connect to a server
3.Enter Server URL
4.Click on Connect
5.Go back
6.Click on Connect again
7.Server Image Not Loaded

Expected behavior:

Server Icon Should show up normally

Screenshot_20240306_204523_RocketChat

Actual behavior:

Screenshot_20240306_204545_RocketChat

Additional context:

How to Reproduce :
https://github.com/RocketChat/Rocket.Chat.ReactNative/assets/89742297/00071883-1fca-43a4-9a10-11f9f91051fa

@Shaik-Sirajuddin
Copy link
Author

The current code fetches server details from db and avoids reconnection to just connected server,

function connect({ server, logoutOnError = false }: { server: string; logoutOnError?: boolean }): Promise<void> {
	return new Promise<void>(resolve => {
		if (sdk.current?.client?.host === server) {
			return resolve();
		}
---

but the icon data is not loaded due to a difference in type definition for Icon

export async function setSettings(): Promise<void> {
	const db = database.active;
	const settingsCollection = db.get('settings');
	const settingsRecords = await settingsCollection.query().fetch();
	const parsed = Object.values(settingsRecords).map(item => ({
		_id: item.id,
		valueAsString: item.valueAsString,
		valueAsBoolean: item.valueAsBoolean,
		valueAsNumber: item.valueAsNumber,
		valueAsArray: item.valueAsArray,
		_updatedAt: item._updatedAt
	}));
	reduxStore.dispatch(addSettings(parseSettings(parsed.slice(0, parsed.length))));
}

@Shaik-Sirajuddin Shaik-Sirajuddin linked a pull request Mar 8, 2024 that will close this issue
10 tasks
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 a pull request may close this issue.

1 participant