mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1110155 - Fixed renamed Loop room not reflected into the panel. r=Standard8
This commit is contained in:
parent
22c59567cc
commit
c98b60738c
@ -568,7 +568,14 @@ loop.panel = (function(_, mozL10n) {
|
||||
|
||||
handleFormSubmit: function(event) {
|
||||
event.preventDefault();
|
||||
this.props.onChange(this.state.text);
|
||||
// While we already validate for a non-empty string in the store, we need
|
||||
// to check it at the component level to avoid desynchronized rendering
|
||||
// issues.
|
||||
if (this.state.text.trim()) {
|
||||
this.props.onChange(this.state.text);
|
||||
} else {
|
||||
this.setState({text: this.props.text});
|
||||
}
|
||||
this.setState({edit: false});
|
||||
},
|
||||
|
||||
|
@ -568,7 +568,14 @@ loop.panel = (function(_, mozL10n) {
|
||||
|
||||
handleFormSubmit: function(event) {
|
||||
event.preventDefault();
|
||||
this.props.onChange(this.state.text);
|
||||
// While we already validate for a non-empty string in the store, we need
|
||||
// to check it at the component level to avoid desynchronized rendering
|
||||
// issues.
|
||||
if (this.state.text.trim()) {
|
||||
this.props.onChange(this.state.text);
|
||||
} else {
|
||||
this.setState({text: this.props.text});
|
||||
}
|
||||
this.setState({edit: false});
|
||||
},
|
||||
|
||||
|
@ -423,10 +423,11 @@ loop.store = loop.store || {};
|
||||
* @param {sharedActions.RenameRoom} actionData
|
||||
*/
|
||||
renameRoom: function(actionData) {
|
||||
var oldRoomName = this.getStoreState("roomName");
|
||||
var newRoomName = actionData.newRoomName.trim();
|
||||
|
||||
// Skip update if name is unchanged or empty.
|
||||
if (!newRoomName || this.getStoreState("roomName") === newRoomName) {
|
||||
if (!newRoomName || oldRoomName === newRoomName) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user