🐛 Bug fixes on realm missing post editor
This commit is contained in:
parent
0c87bbbce1
commit
b3e266d564
@ -115,6 +115,14 @@ abstract class SolianRouter {
|
||||
name: 'realms.member',
|
||||
builder: (context, state) => RealmMemberScreen(realm: state.extra as Realm),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/realms/:realm/posts/publish/moments',
|
||||
name: 'realms.posts.moments.editor',
|
||||
builder: (context, state) => MomentEditorScreen(
|
||||
editing: state.extra as Post?,
|
||||
realm: state.pathParameters['realm']
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/realms/:realm/posts/:dataset/:alias',
|
||||
name: 'realms.posts.details',
|
||||
|
@ -91,8 +91,8 @@ class _ExplorePostWidgetState extends State<ExplorePostWidget> {
|
||||
child: const Icon(Icons.edit),
|
||||
onPressed: () async {
|
||||
final did = await SolianRouter.router.pushNamed(
|
||||
'posts.moments.editor',
|
||||
queryParameters: {'realm': widget.realm},
|
||||
widget.realm == null ? 'posts.moments.editor' : 'realms.posts.moments.editor',
|
||||
pathParameters: widget.realm == null ? {} : {'realm': widget.realm!},
|
||||
);
|
||||
if (did == true) _pagingController.refresh();
|
||||
},
|
||||
|
@ -16,8 +16,9 @@ import 'package:solian/widgets/posts/attachment_editor.dart';
|
||||
|
||||
class MomentEditorScreen extends StatefulWidget {
|
||||
final Post? editing;
|
||||
final String? realm;
|
||||
|
||||
const MomentEditorScreen({super.key, this.editing});
|
||||
const MomentEditorScreen({super.key, this.editing, this.realm});
|
||||
|
||||
@override
|
||||
State<MomentEditorScreen> createState() => _MomentEditorScreenState();
|
||||
@ -61,6 +62,7 @@ class _MomentEditorScreenState extends State<MomentEditorScreen> {
|
||||
'alias': _alias,
|
||||
'content': _textController.value.text,
|
||||
'attachments': _attachments,
|
||||
'realm': widget.realm,
|
||||
});
|
||||
|
||||
var res = await Response.fromStream(await auth.client!.send(req));
|
||||
|
Loading…
Reference in New Issue
Block a user