Skip to content

Commit

Permalink
Merge pull request #435 from poppingmoon/registry-change-domain
Browse files Browse the repository at this point in the history
Misskeyのバージョンによってレジストリのドメインを変更する
  • Loading branch information
shiosyakeyakini-info authored Nov 13, 2023
2 parents 566e27f + 0082088 commit a2f17a5
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -6,9 +6,14 @@ import 'package:miria/view/themes/app_theme.dart';
import 'package:url_launcher/url_launcher.dart';

class AddReactionsDialog extends StatefulWidget {
final Account account;
const AddReactionsDialog({
super.key,
required this.account,
this.domain = "system",
});

const AddReactionsDialog({super.key, required this.account});
final Account account;
final String domain;

@override
State<AddReactionsDialog> createState() => _AddReactionsDialogState();
@@ -33,7 +38,7 @@ class _AddReactionsDialogState extends State<AddReactionsDialog> {
pathSegments: [
"registry",
"value",
"system",
widget.domain,
"client",
"base",
"reactions",
Original file line number Diff line number Diff line change
@@ -152,9 +152,17 @@ class ReactionDeckPageState extends ConsumerState<ReactionDeckPage> {
}

Future<void> showAddReactionsDialog({required BuildContext context}) async {
final endpoints =
await ref.read(misskeyProvider(widget.account)).endpoints();
final domain =
endpoints.contains("i/registry/scopes-with-domain") ? "@" : "system";
if (!mounted) return;
final emojiNames = await showDialog<List<String>>(
context: context,
builder: (context) => AddReactionsDialog(account: widget.account),
builder: (context) => AddReactionsDialog(
account: widget.account,
domain: domain,
),
);
if (emojiNames == null) {
return;

0 comments on commit a2f17a5

Please sign in to comment.