mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 09:59:31 +08:00
修复写日记问题
This commit is contained in:
parent
9c6346f9eb
commit
9dd231c41a
1 changed files with 28 additions and 42 deletions
|
@ -282,14 +282,19 @@ export default class WritePage extends Component {
|
||||||
if (this.state.notebooks.length == 0) {
|
if (this.state.notebooks.length == 0) {
|
||||||
this.contentInput.blur();
|
this.contentInput.blur();
|
||||||
Alert.alert('提示', '没有可用日记本,无法写日记', [
|
Alert.alert('提示', '没有可用日记本,无法写日记', [
|
||||||
{text: '取消', onPress: () => {}},
|
{
|
||||||
{text: '创建一个', onPress: () => {
|
text: '取消', onPress: () => {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '创建一个', onPress: () => {
|
||||||
Navigation.push(this.props.componentId, {
|
Navigation.push(this.props.componentId, {
|
||||||
component: {
|
component: {
|
||||||
name: 'NotebookEdit'
|
name: 'NotebookEdit'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -318,30 +323,11 @@ export default class WritePage extends Component {
|
||||||
Msg.hideMsg(waitingToast);
|
Msg.hideMsg(waitingToast);
|
||||||
Msg.showMsg('日记保存完成');
|
Msg.showMsg('日记保存完成');
|
||||||
DeviceEventEmitter.emit(Event.updateDiarys);
|
DeviceEventEmitter.emit(Event.updateDiarys);
|
||||||
|
this.closePage();
|
||||||
if(this.diary || this.topic) {
|
}).catch(e => {
|
||||||
Navigation.pop(this.props.componentId);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Navigation.setStackRoot(this.props.componentId, {
|
|
||||||
component: {
|
|
||||||
name: 'Empty',
|
|
||||||
options: {
|
|
||||||
bottomTabs: {
|
|
||||||
visible: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
passProps: {
|
|
||||||
from: 'write'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(e => {
|
|
||||||
Msg.hideMsg(waitingToast);
|
Msg.hideMsg(waitingToast);
|
||||||
Msg.showMsg('保存失败');
|
Msg.showMsg('保存失败');
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in a new issue