mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 07:48:40 +00:00
rename
This commit is contained in:
parent
084222eee8
commit
85c0f32f21
2 changed files with 2 additions and 7 deletions
|
|
@ -7,22 +7,17 @@ import 'package:twonly/src/providers/api_provider.dart';
|
|||
import 'package:twonly/src/utils/misc.dart';
|
||||
import 'package:twonly/src/model/user_data_json.dart';
|
||||
|
||||
Future<bool> addNewUser(String username) async {
|
||||
Future<bool> addNewContact(String username) async {
|
||||
final res = await apiProvider.getUserData(username);
|
||||
|
||||
if (res.isSuccess) {
|
||||
print(res.value);
|
||||
print(res.value.userdata.userId);
|
||||
|
||||
if (await SignalHelper.addNewContact(res.value.userdata)) {
|
||||
await dbProvider.db!.insert(DbContacts.tableName, {
|
||||
DbContacts.columnDisplayName: username,
|
||||
DbContacts.columnUserId: res.value.userdata.userId.toInt()
|
||||
});
|
||||
}
|
||||
print("Add new user: ${res}");
|
||||
}
|
||||
|
||||
return res.isSuccess;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class _SearchUsernameView extends State<SearchUsernameView> {
|
|||
});
|
||||
});
|
||||
|
||||
final status = await addNewUser(searchUserName.text);
|
||||
final status = await addNewContact(searchUserName.text);
|
||||
|
||||
timer.cancel();
|
||||
// loaderDelay.timeout(Duration(microseconds: 0));
|
||||
|
|
|
|||
Loading…
Reference in a new issue