mirror of
https://github.com/ente-io/ente.git
synced 2025-08-05 22:27:58 +00:00
[auth] minor fixes
This commit is contained in:
parent
baeb47f94b
commit
74dc15c38c
@ -24,7 +24,7 @@ class ShareCodeDialog extends StatefulWidget {
|
|||||||
|
|
||||||
class _ShareCodeDialogState extends State<ShareCodeDialog> {
|
class _ShareCodeDialogState extends State<ShareCodeDialog> {
|
||||||
final Logger logger = Logger('_ShareCodeDialogState');
|
final Logger logger = Logger('_ShareCodeDialogState');
|
||||||
List<int> items = [5, 15, 30, 60];
|
final List<int> _durationInMins = [2, 5, 15, 30, 60];
|
||||||
|
|
||||||
String getItemLabel(int min) {
|
String getItemLabel(int min) {
|
||||||
if (min == 60) return '1 hour';
|
if (min == 60) return '1 hour';
|
||||||
@ -37,11 +37,12 @@ class _ShareCodeDialogState extends State<ShareCodeDialog> {
|
|||||||
return '$min min';
|
return '$min min';
|
||||||
}
|
}
|
||||||
|
|
||||||
int selectedValue = 15;
|
late final int selectedValue;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
selectedValue = _durationInMins[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -59,7 +60,7 @@ class _ShareCodeDialogState extends State<ShareCodeDialog> {
|
|||||||
DropdownButtonHideUnderline(
|
DropdownButtonHideUnderline(
|
||||||
child: DropdownButton2(
|
child: DropdownButton2(
|
||||||
hint: const Text('Select an option'),
|
hint: const Text('Select an option'),
|
||||||
items: items
|
items: _durationInMins
|
||||||
.map(
|
.map(
|
||||||
(item) => DropdownMenuItem<int>(
|
(item) => DropdownMenuItem<int>(
|
||||||
value: item,
|
value: item,
|
||||||
@ -89,8 +90,8 @@ class _ShareCodeDialogState extends State<ShareCodeDialog> {
|
|||||||
try {
|
try {
|
||||||
await shareCode();
|
await shareCode();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
} catch (e) {
|
} catch (e, s) {
|
||||||
logger.warning('Failed to share code: ${e.toString()}');
|
logger.severe('Failed to generate shared codes', e, s);
|
||||||
showGenericErrorDialog(context: context, error: e).ignore();
|
showGenericErrorDialog(context: context, error: e).ignore();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user