forked from Nexus/nexus
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
85ce14f193 |
|||
|
46474fbae6 |
|||
|
32fd54fd78 |
|||
|
d753dc2261 |
|||
| f84009e602 |
4 changed files with 62 additions and 73 deletions
|
|
@ -130,7 +130,7 @@ class SettingsSectionsController
|
|||
.watch(ClientController.provider.notifier)
|
||||
.setAccountData(
|
||||
.new(
|
||||
type: AccountData.invitePermissionConfigKey,
|
||||
type: InvitePermissionConfig.key,
|
||||
content: InvitePermissionConfig(
|
||||
defaultAction: value,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -15,21 +15,17 @@ abstract class AccountData with _$AccountData {
|
|||
IList<RecentEmoji> recentEmoji,
|
||||
) => {"recent_emoji": recentEmoji.map((emoji) => emoji.toJson()).toList()};
|
||||
|
||||
static const invitePermissionConfigKey = "m.invite_permission_config";
|
||||
static const directKey = "m.direct";
|
||||
static const recentEmojiKey = "m.recent_emoji";
|
||||
|
||||
const factory AccountData({
|
||||
@JsonKey(name: AccountData.invitePermissionConfigKey)
|
||||
@JsonKey(name: InvitePermissionConfig.key)
|
||||
@Default(InvitePermissionConfig())
|
||||
InvitePermissionConfig invitePermissionConfig,
|
||||
|
||||
@JsonKey(name: AccountData.directKey)
|
||||
@JsonKey(name: "m.direct")
|
||||
@Default(IMap.empty())
|
||||
IMap<String, IList<String>> directMessages,
|
||||
|
||||
@JsonKey(
|
||||
name: AccountData.recentEmojiKey,
|
||||
name: "m.recent_emoji",
|
||||
readValue: AccountData.readRecentEmojiValue,
|
||||
toJson: AccountData.recentEmojiToJson,
|
||||
)
|
||||
|
|
@ -43,6 +39,8 @@ abstract class AccountData with _$AccountData {
|
|||
|
||||
@freezed
|
||||
abstract class InvitePermissionConfig with _$InvitePermissionConfig {
|
||||
static const key = "m.invite_permission_config";
|
||||
|
||||
const factory InvitePermissionConfig({
|
||||
@JsonKey(unknownEnumValue: DefaultInviteAction.allow)
|
||||
@Default(DefaultInviteAction.allow)
|
||||
|
|
|
|||
|
|
@ -60,9 +60,7 @@ class SelectServerPage extends HookConsumerWidget {
|
|||
AppLinks().uriLinkStream.listen((encodedUri) async {
|
||||
final state = encodedUri.queryParameters["state"];
|
||||
if (state != codeResponse.state) return;
|
||||
isLoading.value = true;
|
||||
|
||||
try {
|
||||
final code = encodedUri.queryParameters["code"];
|
||||
|
||||
if (code != null) {
|
||||
|
|
@ -84,9 +82,6 @@ class SelectServerPage extends HookConsumerWidget {
|
|||
)
|
||||
.onError(showError);
|
||||
}
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ class RoomAppbar extends ConsumerWidget implements PreferredSizeWidget {
|
|||
constraints: .loose(.fromWidth(400)),
|
||||
child: Padding(
|
||||
padding: .all(24),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: .min,
|
||||
crossAxisAlignment: .start,
|
||||
|
|
@ -67,9 +66,7 @@ class RoomAppbar extends ConsumerWidget implements PreferredSizeWidget {
|
|||
room.metadata?.name ?? "Unnamed Room",
|
||||
overflow: .ellipsis,
|
||||
maxLines: 3,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.headlineSmall,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -89,7 +86,6 @@ class RoomAppbar extends ConsumerWidget implements PreferredSizeWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
leading: isDesktop
|
||||
? room == null
|
||||
? null
|
||||
|
|
|
|||
Loading…
Reference in a new issue