Skip to content

Commit 9d2cc00

Browse files
committed
wip - use save app name
1 parent 1bc108f commit 9d2cc00

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/widgets/autofill_save.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class _AutofillSaveWidgetState extends State<AutofillSaveWidget> with TraceableC
3838
}
3939
final username = autofillState.androidMetadata.saveInfo!.username;
4040
final password = autofillState.androidMetadata.saveInfo!.password;
41+
final appName = autofillState.androidMetadata.saveInfo!.appName ?? '';
4142
//TODO:f: expose value of save compat mode to Entry widget:
4243
//final isCompatMode = autofillState.androidMetadata.saveInfo!.isCompatMode;
4344

@@ -60,14 +61,19 @@ class _AutofillSaveWidgetState extends State<AutofillSaveWidget> with TraceableC
6061

6162
if (webDomain.isNotEmpty) {
6263
newEntry!.addAutofillUrl(webDomain, scheme);
63-
newEntry!.setString(KdbxKeyCommon.TITLE, PlainValue(webDomain));
6464
} else if (appId.isNotEmpty) {
6565
newEntry!.addAndroidPackageName(appId);
66-
newEntry!.setString(KdbxKeyCommon.TITLE, PlainValue(appId));
67-
} else {
68-
newEntry!.setString(KdbxKeyCommon.TITLE, PlainValue('[untitled]'));
6966
}
7067

68+
final newTitle = appName.isNotEmpty
69+
? appName
70+
: webDomain.isNotEmpty
71+
? webDomain
72+
: appId.isNotEmpty
73+
? appId
74+
: '[untitled]';
75+
newEntry!.setString(KdbxKeyCommon.TITLE, PlainValue(newTitle));
76+
7177
username?.let((it) => newEntry!.setString(KdbxKeyCommon.USER_NAME, PlainValue(it)));
7278
password?.let((it) => newEntry!.setString(KdbxKeyCommon.PASSWORD, PlainValue(it)));
7379
BlocProvider.of<EntryCubit>(context).startEditing(newEntry!, startDirty: false);

0 commit comments

Comments
 (0)