prevent deletes without being logged in

This commit is contained in:
stopflock
2026-07-25 17:11:39 -05:00
parent 6a0d4cd8f7
commit 974204bd91
13 changed files with 49 additions and 12 deletions
+25
View File
@@ -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(