mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-08-10 21:20:18 +02:00
prevent deletes without being logged in
This commit is contained in:
@@ -65,6 +65,31 @@ class NodeTagSheet extends StatelessWidget {
|
||||
}
|
||||
|
||||
void deleteNode() async {
|
||||
if (!appState.isLoggedIn) {
|
||||
final shouldLogIn = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
title: Text(locService.t('node.confirmDeleteTitle')),
|
||||
content: Text(locService.t('node.mustBeLoggedInToDelete')),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(locService.cancel),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(locService.t('actions.logIn')),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
if ((shouldLogIn ?? false) && context.mounted) {
|
||||
Navigator.pushNamed(context, '/settings/osm-account');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final result = await showDialog<({bool confirmed, String comment})>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => _DeleteNodeDialog(
|
||||
|
||||
Reference in New Issue
Block a user