common: Only upload if sync is activated

This commit is contained in:
Elias Projahn 2020-07-17 20:24:37 +02:00
parent 322ed3f81e
commit 3f5743e2f5
5 changed files with 16 additions and 48 deletions

View file

@ -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);
},
),
],