-
-
Notifications
You must be signed in to change notification settings - Fork 475
Trim domain to first word in server URL #693
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
base: main
Are you sure you want to change the base?
Conversation
If the app is unable to fetch the realm name, the server alias will now default to first word after the protocol scheme in the server URL.
ffd141b
to
748be34
Compare
Would it make sense to put the |
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.
The function trimDomain() works as expected. It extracts abc from https://abc.zulipchat.com or zulip from http://zulip.orgname.com. We still don't get the org name in the second case, where user accesses a self-hosted server. For rest of the cases, works fine :)
No, it wouldn't i guess. The request-util returns header options for all requests in domain-util, and does not return alias name. |
There are three cases of url here :-
It is easy for us to implement for the first case as done in this case. The problem arises when we want to distinguish between first and second case which I feel is impossible for us to do. I am not sure if showing z in case of 2nd case an improvement from the the current implementation of showing the defaultIcon or is infact an increment of poor UX. Really unsure as to what the way forward should be here in this case. |
@abhigyank correct me if I'm wrong, but the problem here is just the word |
Please let me know if any further changes are required here. |
I don't want us to hard-code here (I am never in favour of hard-coding anything! 😅 ) The reason being we don't want to assume that its always zulip in such a subdomain. I am not sure what is the right way to go here. 😕 |
I agree, hard coding is a pretty hacky solution. I’m also unsure what we
should do. :(
…On Thu, 4 Apr 2019 at 10:44 PM, Abhigyan Khaund ***@***.***> wrote:
but the problem here is just the word zulip in the server URL, right?
If that's the case, we can check if the first word of the URL after the
protocol scheme starts with zulip. If so, then we assume that the URL is of
the form zulip.domain.com and show d.
I don't want us to hard-code here (I am never in favour of hard-coding
anything! 😅 ) The reason being we don't want to assume that its always
zulip in such a subdomain. I am not sure what is the right way to go here.
😕
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/zulip/zulip-electron/pull/693#issuecomment-479985567>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXehUYK57iQ_R2NzwXYh1xq82pn169xeks5vdjLugaJpZM4cUTWD>
.
|
@rishig would you mind having a look at this whenever you're free and telling us what you think? |
I think we should just show some kind of error state if the realm doesn't have an avatar set (e.g. a box with a |
I think that'll be a good solution when we don't have this kind of behaviour come up frequently (which is the case right now). When @akashnimare is able to find time to review #714 and we cut down on the number of times this fallback icon needs to be used, we can use the |
Heads up @kanishk98, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
If the app is unable to fetch the realm name, the server alias will now
default to first word after the protocol scheme in the server URL.
What's this PR do?
Changes
serverConf
object so that if the app is unable to save the correct realm name, the sidebar receives the first character of the URL after://
.Any background context you want to provide?
Discussion at #675
Screenshots?
You have tested this PR on: