mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 05:59:35 +01:00
show loading on add notebook and topic dialog
This commit is contained in:
@@ -26,6 +26,7 @@ export class AddTopicDialog extends React.Component {
|
||||
this.state = {
|
||||
visible: false,
|
||||
titleFocused: false,
|
||||
loading:false
|
||||
};
|
||||
|
||||
this.title;
|
||||
@@ -34,6 +35,7 @@ export class AddTopicDialog extends React.Component {
|
||||
}
|
||||
|
||||
addNewTopic = async () => {
|
||||
this.setState({loading:true})
|
||||
if (!this.title)
|
||||
return ToastEvent.show('Title is required', 'error', 'local');
|
||||
|
||||
@@ -112,6 +114,7 @@ export class AddTopicDialog extends React.Component {
|
||||
positiveTitle={toEdit ? 'Save' : 'Add'}
|
||||
onPressNegative={() => this.close()}
|
||||
onPressPositive={() => this.addNewTopic()}
|
||||
loading={this.state.loading}
|
||||
/>
|
||||
</DialogContainer>
|
||||
<Toast context="local" />
|
||||
|
||||
Reference in New Issue
Block a user