Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3381961
D7589.id25616.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7589.id25616.diff
View Options
diff --git a/native/chat/settings/thread-settings-description.react.js b/native/chat/settings/thread-settings-description.react.js
--- a/native/chat/settings/thread-settings-description.react.js
+++ b/native/chat/settings/thread-settings-description.react.js
@@ -74,17 +74,6 @@
this.props.descriptionEditValue !== null &&
this.props.descriptionEditValue !== undefined
) {
- let button;
- if (this.props.loadingStatus !== 'loading') {
- button = <SaveSettingButton onPress={this.onSubmit} />;
- } else {
- button = (
- <ActivityIndicator
- size="small"
- color={this.props.colors.panelForegroundSecondaryLabel}
- />
- );
- }
const textInputStyle = {};
if (
this.props.descriptionTextHeight !== undefined &&
@@ -109,7 +98,7 @@
ref={this.textInputRef}
selectionColor={`#${this.props.threadInfo.color}`}
/>
- {button}
+ {this.renderButton()}
</View>
<ThreadSettingsCategoryFooter type="full" />
</View>
@@ -124,11 +113,7 @@
<Text style={this.props.styles.text} onLayout={this.onLayoutText}>
{this.props.threadInfo.description}
</Text>
- <EditSettingButton
- onPress={this.onPressEdit}
- canChangeSettings={this.props.canChangeSettings}
- key="editButton"
- />
+ {this.renderButton()}
</View>
<ThreadSettingsCategoryFooter type="full" />
</View>
@@ -170,6 +155,28 @@
return null;
}
+ renderButton() {
+ if (this.props.loadingStatus === 'loading') {
+ return (
+ <ActivityIndicator
+ size="small"
+ color={this.props.colors.panelForegroundSecondaryLabel}
+ />
+ );
+ } else if (
+ this.props.descriptionEditValue === null ||
+ this.props.descriptionEditValue === undefined
+ ) {
+ return (
+ <EditSettingButton
+ onPress={this.onPressEdit}
+ canChangeSettings={this.props.canChangeSettings}
+ />
+ );
+ }
+ return <SaveSettingButton onPress={this.onSubmit} />;
+ }
+
textInputRef = (textInput: ?React.ElementRef<typeof BaseTextInput>) => {
this.textInput = textInput;
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 7:36 AM (19 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596331
Default Alt Text
D7589.id25616.diff (2 KB)
Attached To
Mode
D7589: [native] fix rendering of edit thread description setting button
Attached
Detach File
Event Timeline
Log In to Comment