keep message drafts on room switches
this is for you courge
This commit is contained in:
parent
7f7bdbf525
commit
e899bb3929
2 changed files with 357 additions and 194 deletions
|
|
@ -122,9 +122,9 @@ final class const ChatBody({
|
|||
.send(
|
||||
text,
|
||||
tags: tags,
|
||||
relationType: composer.relationType.value,
|
||||
relationType: composer.relationType,
|
||||
shouldMention: shouldMention,
|
||||
relatedEventRowId: composer.relatedEvent.value,
|
||||
relatedEventRowId: composer.relatedEvent,
|
||||
)
|
||||
.onError(showError),
|
||||
onSendSticker: (shortcode, image, {required shouldMention}) =>
|
||||
|
|
@ -153,12 +153,6 @@ final class const ChatBody({
|
|||
onSendBotCommand: (draft) => notifier
|
||||
.sendBotCommand(draft, repliedEventRowId: repliedEventRowId)
|
||||
.onError(showError),
|
||||
relationType: composer.relationType.value,
|
||||
relatedEvent: composer.relatedEvent.value,
|
||||
onDismiss: () {
|
||||
composer.relatedEvent.value = null;
|
||||
composer.node.requestFocus();
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ final class const RoomChat({
|
|||
}) extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final composer = ChatComposer.use();
|
||||
final pendingJump = ref.read(JumpRequestController.provider);
|
||||
final contextualEvent = useState<int?>(switch (pendingJump) {
|
||||
// Threaded events open their thread instead, leaving the timeline
|
||||
|
|
@ -76,6 +75,7 @@ final class const RoomChat({
|
|||
}
|
||||
|
||||
final roomId = this.roomId!;
|
||||
final composer = ChatComposer.use(ref, (roomId: roomId, threadRoot: null));
|
||||
|
||||
final jumpRowId = ref.watch(
|
||||
JumpRequestController.provider.select(
|
||||
|
|
|
|||
Loading…
Reference in a new issue