mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 15:30:40 +00:00
fix(auth): update parse error message
This commit is contained in:
parent
2bc40812d6
commit
b714392fb2
@ -435,6 +435,6 @@
|
|||||||
"editTag": "Edit Tag",
|
"editTag": "Edit Tag",
|
||||||
"deleteTagTitle": "Delete tag?",
|
"deleteTagTitle": "Delete tag?",
|
||||||
"deleteTagMessage": "Are you sure you want to delete this tag? This action is irreversible.",
|
"deleteTagMessage": "Are you sure you want to delete this tag? This action is irreversible.",
|
||||||
"somethingWentWrongUpdateApp": "Something went wrong, please update the app",
|
"somethingWentWrongParsingCode": "We were unable to parse {x} codes.",
|
||||||
"updateNotAvailable": "Update not available"
|
"updateNotAvailable": "Update not available"
|
||||||
}
|
}
|
@ -26,7 +26,7 @@ class CodeStore {
|
|||||||
final mode = accountMode ?? _authenticatorService.getAccountMode();
|
final mode = accountMode ?? _authenticatorService.getAccountMode();
|
||||||
final List<EntityResult> entities =
|
final List<EntityResult> entities =
|
||||||
await _authenticatorService.getEntities(mode);
|
await _authenticatorService.getEntities(mode);
|
||||||
final List<Code> codes = [];
|
final List<Code> codes = [Code.withError("error", "gsd")];
|
||||||
|
|
||||||
for (final entity in entities) {
|
for (final entity in entities) {
|
||||||
late Code code;
|
late Code code;
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
import 'package:ente_auth/ente_theme_data.dart';
|
import 'package:ente_auth/ente_theme_data.dart';
|
||||||
import 'package:ente_auth/l10n/l10n.dart';
|
import 'package:ente_auth/l10n/l10n.dart';
|
||||||
import 'package:ente_auth/services/update_service.dart';
|
|
||||||
import 'package:ente_auth/theme/ente_theme.dart';
|
import 'package:ente_auth/theme/ente_theme.dart';
|
||||||
import 'package:ente_auth/ui/common/gradient_button.dart';
|
import 'package:ente_auth/ui/common/gradient_button.dart';
|
||||||
import 'package:ente_auth/ui/linear_progress_widget.dart';
|
import 'package:ente_auth/ui/linear_progress_widget.dart';
|
||||||
import 'package:ente_auth/ui/settings/app_update_dialog.dart';
|
import 'package:ente_auth/utils/dialog_util.dart';
|
||||||
import 'package:ente_auth/utils/toast_util.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class CodeErrorWidget extends StatelessWidget {
|
class CodeErrorWidget extends StatelessWidget {
|
||||||
const CodeErrorWidget({super.key});
|
const CodeErrorWidget({
|
||||||
|
super.key,
|
||||||
|
required this.errors,
|
||||||
|
});
|
||||||
|
|
||||||
|
final int errors;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -40,7 +43,7 @@ class CodeErrorWidget extends StatelessWidget {
|
|||||||
fractionOfStorage: 1,
|
fractionOfStorage: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 16),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
@ -67,44 +70,30 @@ class CodeErrorWidget extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
context.l10n.somethingWentWrongUpdateApp,
|
context.l10n.somethingWentWrongParsingCode(errors),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const Spacer(),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 76,
|
width: 102,
|
||||||
height: 28,
|
height: 28,
|
||||||
child: GradientButton(
|
child: GradientButton(
|
||||||
text: context.l10n.update,
|
text: context.l10n.contactSupport,
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
try {
|
await showErrorDialog(
|
||||||
await UpdateService.instance.shouldUpdate();
|
context,
|
||||||
assert(
|
context.l10n.contactSupport,
|
||||||
UpdateService.instance.getLatestVersionInfo() != null,
|
context.l10n
|
||||||
);
|
.contactSupportViaEmailMessage("support@ente.io"),
|
||||||
await showDialog(
|
);
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AppUpdateDialog(
|
|
||||||
UpdateService.instance.getLatestVersionInfo(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
barrierColor: Colors.black.withOpacity(0.85),
|
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
showToast(
|
|
||||||
context,
|
|
||||||
context.l10n.updateNotAvailable,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
borderWidth: 0.6,
|
borderWidth: 0.6,
|
||||||
borderRadius: 6,
|
borderRadius: 6,
|
||||||
@ -113,6 +102,7 @@ class CodeErrorWidget extends StatelessWidget {
|
|||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -356,7 +356,12 @@ class _HomePageState extends State<HomePage> {
|
|||||||
padding: const EdgeInsets.only(bottom: 80),
|
padding: const EdgeInsets.only(bottom: 80),
|
||||||
itemBuilder: ((context, index) {
|
itemBuilder: ((context, index) {
|
||||||
if (index == 0 && anyCodeHasError) {
|
if (index == 0 && anyCodeHasError) {
|
||||||
return const CodeErrorWidget();
|
return CodeErrorWidget(
|
||||||
|
errors: _allCodes
|
||||||
|
?.where((element) => element.hasError)
|
||||||
|
.length ??
|
||||||
|
0,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
final newIndex = index - indexOffset;
|
final newIndex = index - indexOffset;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user