-
-
Notifications
You must be signed in to change notification settings - Fork 832
Shift to M_RESOURCE_LIMIT_EXCEEDED errors #2120
Conversation
With support for admin_contact and limit_type fields For element-hq/element-web#7091
@@ -434,17 +434,21 @@ const LoggedInView = React.createClass({ | |||
} | |||
|
|||
const mauLimitEvent = this.state.serverNoticeEvents.find((e) => { |
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.
As MAU is now just one case of resource limit exceeded, how about renaming the variables that are not specific to MAU?
@@ -327,11 +327,18 @@ module.exports = React.createClass({ | |||
} else { | |||
let consentError = null; | |||
let mauError = null; | |||
const translateMauError = sub => { | |||
if (mauError.data.admin_contact) { | |||
return <a href={mauError.data.admin_contact} target="_blank" rel="noopener">{sub}</a>; |
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.
mailto?
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 admin contact should be a URI, so it should already have mailto: if it's an email address (also lets you specify a web form or something)
{ | ||
a: (sub) => { | ||
if (response.data.admin_contact) { | ||
return <a rel="noopener" target="_blank" href={response.data.admin_contact}>{sub}</a>; |
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.
same here, admin_contact is a e-mail address I presume, so you might need a mailto:
prefix to turn it into a url.
@@ -164,10 +164,22 @@ module.exports = React.createClass({ | |||
if (!success) { | |||
let msg = response.message || response.toString(); | |||
// can we give a better error message? | |||
if (response.errcode == 'M_MAU_LIMIT_EXCEEDED') { | |||
if (response.errcode == 'M_RESOURCE_LIMIT_EXCEEDED') { |
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.
There seems to be a bit of duplication across RoomStatusBar
, Login
, Registration
& ServerLimitBar
for this use case, with the only thing different being the specific translation string to use. I wonder if it would make sense to put some of this somewhere centralized (e.g. a helper)?
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.
Yeah, it is a bit - hopefully this is a bit better now.
With support for admin_contact and limit_type fields
For element-hq/element-web#7091