Lemmy v0.15.0 changes (#314)

This commit is contained in:
Filip Krawczyk 2022-01-14 14:25:31 +01:00 committed by GitHub
parent 026252804f
commit 682e1af2c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 91 additions and 48 deletions

View File

@ -12,7 +12,7 @@ PODS:
- Flutter - Flutter
- shared_preferences_ios (0.0.1): - shared_preferences_ios (0.0.1):
- Flutter - Flutter
- url_launcher (0.0.1): - url_launcher_ios (0.0.1):
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
@ -23,7 +23,7 @@ DEPENDENCIES:
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
EXTERNAL SOURCES: EXTERNAL SOURCES:
Flutter: Flutter:
@ -40,8 +40,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/share_plus/ios" :path: ".symlinks/plugins/share_plus/ios"
shared_preferences_ios: shared_preferences_ios:
:path: ".symlinks/plugins/shared_preferences_ios/ios" :path: ".symlinks/plugins/shared_preferences_ios/ios"
url_launcher: url_launcher_ios:
:path: ".symlinks/plugins/url_launcher/ios" :path: ".symlinks/plugins/url_launcher_ios/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
@ -51,7 +51,7 @@ SPEC CHECKSUMS:
path_provider_ios: 7d7ce634493af4477d156294792024ec3485acd5 path_provider_ios: 7d7ce634493af4477d156294792024ec3485acd5
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68 share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_ios: aef470a42dc4675a1cdd50e3158b42e3d1232b32 shared_preferences_ios: aef470a42dc4675a1cdd50e3158b42e3d1232b32
url_launcher: b6e016d912f04be9f5bf6e8e82dc599b7ba59649 url_launcher_ios: 02f1989d4e14e998335b02b67a7590fa34f971af
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

View File

@ -173,7 +173,7 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1250; LastUpgradeCheck = 1300;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {

View File

@ -21,7 +21,6 @@ import '../widgets/sortable_infinite_list.dart';
import '../widgets/user_tile.dart'; import '../widgets/user_tile.dart';
import 'communities_list.dart'; import 'communities_list.dart';
import 'modlog/modlog.dart'; import 'modlog/modlog.dart';
import 'users_list.dart';
/// Displays posts, comments, and general info about the given instance /// Displays posts, comments, and general info about the given instance
class InstancePage extends HookWidget { class InstancePage extends HookWidget {
@ -220,15 +219,15 @@ class _AboutTab extends HookWidget {
required this.instanceHost, required this.instanceHost,
}); });
void goToBannedUsers(BuildContext context) { // void goToBannedUsers(BuildContext context) {
goTo( // goTo(
context, // context,
(_) => UsersListPage( // (_) => UsersListPage(
users: site.banned.reversed.toList(), // users: site.banned.reversed.toList(),
title: L10n.of(context).banned_users, // title: L10n.of(context).banned_users,
), // ),
); // );
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -359,10 +358,11 @@ class _AboutTab extends HookWidget {
expanded: true, expanded: true,
), ),
const _Divider(), const _Divider(),
ListTile( // TODO: transition to new API
title: Center(child: Text(L10n.of(context).banned_users)), // ListTile(
onTap: () => goToBannedUsers(context), // title: Center(child: Text(L10n.of(context).banned_users)),
), // onTap: () => goToBannedUsers(context),
// ),
ListTile( ListTile(
title: Center(child: Text(L10n.of(context).modlog)), title: Center(child: Text(L10n.of(context).modlog)),
onTap: () => Navigator.of(context).push( onTap: () => Navigator.of(context).push(

View File

@ -7,6 +7,7 @@ import 'package:url_launcher/url_launcher.dart' as ul;
import '../../hooks/delayed_loading.dart'; import '../../hooks/delayed_loading.dart';
import '../../hooks/stores.dart'; import '../../hooks/stores.dart';
import '../../l10n/l10n.dart'; import '../../l10n/l10n.dart';
import '../../stores/accounts_store.dart';
import '../../stores/config_store.dart'; import '../../stores/config_store.dart';
import '../../widgets/cached_network_image.dart'; import '../../widgets/cached_network_image.dart';
import '../../widgets/fullscreenable_image.dart'; import '../../widgets/fullscreenable_image.dart';
@ -63,6 +64,14 @@ class AddAccountPage extends HookWidget {
} }
Navigator.of(context).pop(); Navigator.of(context).pop();
} on VerifyEmailException {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Verification email sent'),
));
} on RegistrationApplicationSentException {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Registration application sent'),
));
} on Exception catch (err) { } on Exception catch (err) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar( ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(err.toString()), content: Text(err.toString()),

View File

@ -187,10 +187,19 @@ class AccountsStore extends ChangeNotifier {
} }
final lemmy = LemmyApiV3(instanceHost); final lemmy = LemmyApiV3(instanceHost);
final jwt = await lemmy.run(Login( final response = await lemmy.run(Login(
usernameOrEmail: usernameOrEmail, usernameOrEmail: usernameOrEmail,
password: password, password: password,
)); ));
final jwt = response.jwt;
if (jwt == null) {
if (response.verifyEmailSent) {
throw const VerifyEmailException();
} else if (response.registrationCreated) {
throw const RegistrationApplicationSentException();
}
throw Exception('Unknown error'); // should never happen
}
final userData = await lemmy final userData = await lemmy
.run(GetSite(auth: jwt.raw)) .run(GetSite(auth: jwt.raw))
.then((value) => value.myUser!.localUserView.person); .then((value) => value.myUser!.localUserView.person);
@ -269,3 +278,19 @@ class UserData {
Map<String, dynamic> toJson() => _$UserDataToJson(this); Map<String, dynamic> toJson() => _$UserDataToJson(this);
} }
//if (data.verify_email_sent) {
// toast(i18n.t("verify_email_sent"));
// }
// if (data.registration_created) {
// toast(i18n.t("registration_application_sent"));
// }
class VerifyEmailException implements Exception {
final message = 'verify_email_sent';
const VerifyEmailException();
}
class RegistrationApplicationSentException implements Exception {
final message = 'registration_application_sent';
const RegistrationApplicationSentException();
}

View File

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "32.0.0" version: "33.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.1.0"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@ -98,7 +98,7 @@ packages:
name: built_value name: built_value
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.1.3" version: "8.1.4"
characters: characters:
dependency: transitive dependency: transitive
description: description:
@ -189,7 +189,7 @@ packages:
name: extended_image_library name: extended_image_library
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.1" version: "3.1.2"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -236,7 +236,7 @@ packages:
name: flutter_keyboard_visibility name: flutter_keyboard_visibility
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.1.0" version: "5.1.1"
flutter_keyboard_visibility_platform_interface: flutter_keyboard_visibility_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -384,7 +384,7 @@ packages:
name: image name: image
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.0" version: "3.1.1"
image_picker: image_picker:
dependency: "direct main" dependency: "direct main"
description: description:
@ -398,14 +398,14 @@ packages:
name: image_picker_for_web name: image_picker_for_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.1.5"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: image_picker_platform_interface name: image_picker_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.1" version: "2.4.3"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@ -440,7 +440,7 @@ packages:
name: json_serializable name: json_serializable
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.3" version: "6.1.4"
keyboard_dismisser: keyboard_dismisser:
dependency: "direct main" dependency: "direct main"
description: description:
@ -461,7 +461,7 @@ packages:
name: lemmy_api_client name: lemmy_api_client
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.18.0" version: "0.19.0"
logging: logging:
dependency: "direct main" dependency: "direct main"
description: description:
@ -615,28 +615,35 @@ packages:
name: path_provider_linux name: path_provider_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.1.5"
path_provider_macos: path_provider_macos:
dependency: transitive dependency: transitive
description: description:
name: path_provider_macos name: path_provider_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.4" version: "2.0.5"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: path_provider_platform_interface name: path_provider_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.3"
path_provider_windows: path_provider_windows:
dependency: transitive dependency: transitive
description: description:
name: path_provider_windows name: path_provider_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.4" version: "2.0.5"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.1"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -664,7 +671,7 @@ packages:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.2"
pool: pool:
dependency: transitive dependency: transitive
description: description:
@ -748,28 +755,28 @@ packages:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.11" version: "2.0.12"
shared_preferences_android: shared_preferences_android:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_android name: shared_preferences_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.9" version: "2.0.10"
shared_preferences_ios: shared_preferences_ios:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_ios name: shared_preferences_ios
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.8" version: "2.0.9"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_linux name: shared_preferences_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.3" version: "2.0.4"
shared_preferences_macos: shared_preferences_macos:
dependency: transitive dependency: transitive
description: description:
@ -790,14 +797,14 @@ packages:
name: shared_preferences_web name: shared_preferences_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.0.3"
shared_preferences_windows: shared_preferences_windows:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_windows name: shared_preferences_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.3" version: "2.0.4"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
@ -907,21 +914,21 @@ packages:
name: url_launcher name: url_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.17" version: "6.0.18"
url_launcher_android: url_launcher_android:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_android name: url_launcher_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.13" version: "6.0.14"
url_launcher_ios: url_launcher_ios:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_ios name: url_launcher_ios
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.13" version: "6.0.14"
url_launcher_linux: url_launcher_linux:
dependency: transitive dependency: transitive
description: description:
@ -942,14 +949,14 @@ packages:
name: url_launcher_platform_interface name: url_launcher_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.4" version: "2.0.5"
url_launcher_web: url_launcher_web:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_web name: url_launcher_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.5" version: "2.0.6"
url_launcher_windows: url_launcher_windows:
dependency: transitive dependency: transitive
description: description:

View File

@ -47,7 +47,7 @@ dependencies:
# utils # utils
timeago: ^3.0.2 timeago: ^3.0.2
fuzzy: ^0.4.0-nullsafety.0 fuzzy: ^0.4.0-nullsafety.0
lemmy_api_client: ^0.18.0 lemmy_api_client: ^0.19.0
intl: ^0.17.0 intl: ^0.17.0
matrix4_transform: ^2.0.0 matrix4_transform: ^2.0.0
json_annotation: ^4.3.0 json_annotation: ^4.3.0

View File

@ -19,6 +19,8 @@ const _lemmyUserSettings = LocalUserSettings(
showBotAccounts: true, showBotAccounts: true,
showNewPostNotifs: true, showNewPostNotifs: true,
instanceHost: '', instanceHost: '',
emailVerified: true,
acceptedApplication: true,
); );
void main() { void main() {