mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	streams: Fix stream color synchronization.
Previously, when a new stream was created on a client other than the current one, the browser would first receive the "stream_created" event, and make up a client-side display color at that time to use in the "stream settings" view (it doesn't yet know the color that was selected when the user was actually subscribed, because it doesn't even know yet that the user is being subscribed to this stream), and then moments after it'll receive a "susbcribe" event letting the client know that the user is subscribed (and specifying the color to use). However, due to an argument not being passed through properly and a missing rerender, we were not properly updating either the data structures or doing a stream colors rerender in order to show the new color. This fixes the issue reported in https://chat.zulip.org/#narrow/stream/48-mobile/subject/stream.20colors/near/660170
This commit is contained in:
		| @@ -100,8 +100,9 @@ exports.mark_subscribed = function (sub, subscribers, color) { | ||||
|     } | ||||
|  | ||||
|     // If the backend sent us a color, use that | ||||
|     if (color !== undefined) { | ||||
|     if (color !== undefined && sub.color !== color) { | ||||
|         sub.color = color; | ||||
|         stream_color.update_stream_color(sub, color, {update_historical: true}); | ||||
|     } else if (sub.color === undefined) { | ||||
|         // If the backend didn't, and we have a color already, send | ||||
|         // the backend that color.  It's not clear this code path is | ||||
|   | ||||
		Reference in New Issue
	
	Block a user