Skip to content

Commit

Permalink
fix: open hashtags form when post to hashtag (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon authored Dec 1, 2024
1 parent ea69a8e commit d159459
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/view/page/tag/tag_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';

import '../../../i18n/strings.g.dart';
import '../../../model/account.dart';
import '../../../provider/account_settings_notifier_provider.dart';
import '../../../provider/api/tag_notes_notifier_provider.dart';
import '../../../provider/post_form_hashtags_notifier_provider.dart';
import 'tag_notes.dart';
Expand Down Expand Up @@ -51,11 +52,22 @@ class TagPage extends ConsumerWidget {
ref
.read(postFormHashtagsNotifierProvider(account).notifier)
.updateHashtags([tag]);
final useHashtags = ref
.read(accountSettingsNotifierProvider(account))
.postFormUseHashtags;
await ref
.read(accountSettingsNotifierProvider(account).notifier)
.setPostFormUseHashtags(true);
if (!context.mounted) return;
await context.push('/$account/post');
if (!context.mounted) return;
ref
.read(postFormHashtagsNotifierProvider(account).notifier)
.updateHashtags(hashtags);
ref.invalidate(tagNotesNotifierProvider(account, tag));
await ref
.read(accountSettingsNotifierProvider(account).notifier)
.setPostFormUseHashtags(useHashtags);
},
label: Text(t.misskey.postToHashtag),
icon: const Icon(Icons.edit),
Expand Down

0 comments on commit d159459

Please sign in to comment.