channel creator fixes. fix wallet sync disable / re-enable errors.

This commit is contained in:
Akinwale Ariwodola 2019-09-26 07:25:33 +01:00
parent eebb25dba0
commit 62ac844084
5 changed files with 40 additions and 19 deletions

View file

@ -562,8 +562,8 @@ export default class ChannelCreator extends React.PureComponent {
newChannelBidError: '',
createChannelError: undefined,
showCreateChannel: false,
thumbnailUrl: null,
coverImageUrl: null,
thumbnailUrl: '',
coverImageUrl: '',
avatarImagePickerOpen: false,
coverImagePickerOpen: false,
@ -914,7 +914,7 @@ export default class ChannelCreator extends React.PureComponent {
<View>
<Text style={channelCreatorStyle.channelAt}>@</Text>
<TextInput
editable={canSave && !creatingChannel && !updatingChannel}
editable={canSave && !editMode && !creatingChannel && !updatingChannel}
style={channelCreatorStyle.channelNameInput}
value={this.state.newChannelName}
onChangeText={value => this.handleNewChannelNameChange(value, true)}
@ -924,10 +924,15 @@ export default class ChannelCreator extends React.PureComponent {
onBlur={() => this.setState({ channelNameFocused: false })}
/>
</View>
s
</View>
{newChannelNameError.length > 0 && (
<Text style={channelCreatorStyle.inlineError}>{newChannelNameError}</Text>
)}
{editMode && (
<Text style={channelCreatorStyle.helpText}>The channel name cannot be changed while editing.</Text>
)}
<View style={channelCreatorStyle.bidRow}>
<Text style={channelCreatorStyle.label}>Deposit</Text>
<TextInput

View file

@ -80,9 +80,8 @@ class FirstRunScreen extends React.PureComponent {
}
if (this.state.syncApplyStarted && !syncApplyIsPending) {
this.setState({ syncApplyStarted: false });
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
notify({ message: syncApplyErrorMessage, isError: true });
notify({ message: syncApplyErrorMessage, syncApplyStarted: false, isError: true });
this.setState({ showBottomContainer: true });
} else {
// password successfully verified
@ -236,6 +235,7 @@ class FirstRunScreen extends React.PureComponent {
closeFinalPage() {
// Final page. Let the app know that first run experience is completed.
this.setState({ syncApplyStarted: false });
if (NativeModules.FirstRun) {
NativeModules.FirstRun.firstRunCompleted();
}

View file

@ -68,26 +68,36 @@ class SyncVerifyPage extends React.PureComponent {
);
}
setDefaultAccount(
() => {
() => this.finishSync(true),
err => {
// fail silently and still finish
this.finishSync();
}
);
}
}
}
finishSync = (notifyUnlockFailed = false) => {
const { navigation, notify, setClientSetting } = this.props;
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
// unlock the wallet
// unlock the wallet (if locked)
Lbry.status().then(status => {
if (status.wallet.is_locked) {
Lbry.account_unlock({ password: this.state.password ? this.state.password : '' })
.then(() => navigation.goBack())
.catch(err =>
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' })
);
},
err => {
notify({
message:
'The account restore operation could not be completed successfully. Please restart the app and try again.',
.catch(err => {
if (notifyUnlockFailed) {
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' });
}
});
} else {
navigation.goBack();
}
);
}
}
}
});
};
handleChangeText = text => {
// save the value to the state email

View file

@ -45,6 +45,7 @@ const channelCreatorStyle = StyleSheet.create({
helpText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 12,
color: Colors.DescriptionGrey,
},
channelTitleInput: {
marginBottom: 4,

View file

@ -436,6 +436,11 @@ const publishStyle = StyleSheet.create({
fontSize: 14,
color: Colors.DescriptionGrey,
},
helpText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 12,
color: Colors.DescriptionGrey,
},
publishesFooter: {
marginTop: 2,
marginLeft: 16,