mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
common: Only upload if sync is activated
This commit is contained in:
parent
322ed3f81e
commit
3f5743e2f5
5 changed files with 16 additions and 48 deletions
|
|
@ -64,20 +64,13 @@ class _InstrumentEditorState extends State<InstrumentEditor> {
|
|||
synced: false,
|
||||
);
|
||||
|
||||
final success =
|
||||
await backend.client.putInstrument(instrument);
|
||||
await backend.db.updateInstrument(instrument);
|
||||
|
||||
setState(() {
|
||||
uploading = false;
|
||||
});
|
||||
|
||||
if (success) {
|
||||
Navigator.pop(context, instrument);
|
||||
} else {
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text('Failed to upload'),
|
||||
));
|
||||
}
|
||||
Navigator.pop(context, instrument);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue