Page MenuHomePhabricator

D7588.id25619.diff
No OneTemporary

D7588.id25619.diff

diff --git a/native/chat/settings/thread-settings-name.react.js b/native/chat/settings/thread-settings-name.react.js
--- a/native/chat/settings/thread-settings-name.react.js
+++ b/native/chat/settings/thread-settings-name.react.js
@@ -67,6 +67,28 @@
);
}
+ renderButton() {
+ if (this.props.loadingStatus === 'loading') {
+ return (
+ <ActivityIndicator
+ size="small"
+ color={this.props.colors.panelForegroundSecondaryLabel}
+ />
+ );
+ } else if (
+ this.props.nameEditValue === null ||
+ this.props.nameEditValue === undefined
+ ) {
+ return (
+ <EditSettingButton
+ onPress={this.onPressEdit}
+ canChangeSettings={this.props.canChangeSettings}
+ />
+ );
+ }
+ return <SaveSettingButton onPress={this.onSubmit} />;
+ }
+
renderContent() {
if (
this.props.nameEditValue === null ||
@@ -77,26 +99,11 @@
<SingleLine style={this.props.styles.currentValue}>
{this.props.threadInfo.uiName}
</SingleLine>
- <EditSettingButton
- onPress={this.onPressEdit}
- canChangeSettings={this.props.canChangeSettings}
- />
+ {this.renderButton()}
</React.Fragment>
);
}
- let button;
- if (this.props.loadingStatus !== 'loading') {
- button = <SaveSettingButton onPress={this.onSubmit} />;
- } else {
- button = (
- <ActivityIndicator
- size="small"
- color={this.props.colors.panelForegroundSecondaryLabel}
- />
- );
- }
-
return (
<React.Fragment>
<TextInput
@@ -111,7 +118,7 @@
selectionColor={`#${this.props.threadInfo.color}`}
maxLength={chatNameMaxLength}
/>
- {button}
+ {this.renderButton()}
</React.Fragment>
);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 8:38 AM (21 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596446
Default Alt Text
D7588.id25619.diff (1 KB)

Event Timeline