🐛 Fixes articles bugs

This commit is contained in:
LittleSheep 2025-07-02 23:57:07 +08:00
parent f479b9fc8b
commit 050750a808
2 changed files with 18 additions and 10 deletions

View File

@ -324,9 +324,7 @@ class CreatorHubScreen extends HookConsumerWidget {
subtitle: Text('createPublisherHint').tr(), subtitle: Text('createPublisherHint').tr(),
trailing: const Icon(Symbols.chevron_right), trailing: const Icon(Symbols.chevron_right),
onTap: () { onTap: () {
context.push('/creators/publishers/new').then(( context.push('/creators/new').then((value) {
value,
) {
if (value != null) { if (value != null) {
ref.invalidate(publishersManagedProvider); ref.invalidate(publishersManagedProvider);
} }

View File

@ -238,7 +238,7 @@ class ArticleComposeScreen extends HookConsumerWidget {
children: [ children: [
// Publisher row // Publisher row
Card( Card(
margin: EdgeInsets.only(bottom: 8), margin: EdgeInsets.only(top: 8),
elevation: 1, elevation: 1,
child: Padding( child: Padding(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
@ -265,12 +265,22 @@ class ArticleComposeScreen extends HookConsumerWidget {
}); });
}, },
), ),
const Gap(12), const Gap(16),
Text( if (state.currentPublisher.value == null)
state.currentPublisher.value?.name ?? Text(
'postPublisherUnselected'.tr(), 'postPublisherUnselected'.tr(),
style: theme.textTheme.bodyMedium, style: theme.textTheme.bodyMedium,
), )
else
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(state.currentPublisher.value!.nick).bold(),
Text(
'@${state.currentPublisher.value!.name}',
).fontSize(12),
],
),
], ],
), ),
), ),