-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cannot override ServerTypes and default URL #8628
Comments
I agree these components are too tightly coupled at the moment. See also #8297. Having said that, if you do configure a default HS in config.json, Riot should pre-select the advanced / other column and show the correct server name: Do you see something else? |
@jryans You are correct. That is the default behavior, and it is working as expected. However, what I am trying to do is provide my own In my fork of riot-web, I've created this custom component, and it is working fine! However the "Create your matrix.org account" text still shows even though it connects to my own HS. |
This should be fixed by matrix-org/matrix-react-sdk#2941 now that the |
Fixed by matrix-org/matrix-react-sdk#3001 - it won't make it into 1.2.0, but should be in the next regularly scheduled release. |
Unfortunately, it is not fixed yet. The problem is that matrix-react-sdk/src/components/structures/auth/Registration.js is importing the function In my project I've provided a different component that replaces However because this function is cherry-picked out of the default @turt2live said:
That's exactly the problem, you can't override it. Would it be possible to re-open this issue and take another look? |
You should be able to override it with:
at least, this is what worked for me in testing and just now. |
@turt2live many thanks! Sorry for the noise. I don't use js that often, so it didn't occur to me I could just monkey patch the TYPES object that way. Thanks again! |
Problem: The ServerTypeSelector module is too tightly coupled to the Registration component.
The template string
yourMatrixAccountText = _t('Create your %(serverName)s account', {
inRegistrationForm
always hasserverName
set to matrix.org, even when you change default HS url in config.json.Screenshot:
Use case: In a custom matrix-react-sdk skin, I want to be able to override the default Free/Premium/Advanced server types. The simplest case is changing the default Free hs/is urls to be my own homeserver url. One expects that the UI should also reflect these skin changes.
Root Cause:
This block of code in Registration.js always has
hsUrl
defined as the static string fromServerTypeSelector
. And even if I provide a component that replacesServerTypeSelector
, I cannot override the constantTYPES
.Replacing the
Registration
component as well is not really an option as it is over 500 LOC and provides lots of functionality that would be common to many skins.The text was updated successfully, but these errors were encountered: