Skip to content

Commit

Permalink
TW-728: fix error can't share file when share to the same room before
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn committed Oct 16, 2023
1 parent 2a97937 commit 77b57a4
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lib/pages/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,18 +312,23 @@ class ChatController extends State<Chat>
}

_askToAcceptInvitation();
if (shareFile != null && room != null && shareFile!.filePath != null) {
final sendFileInteractor = getIt.get<SendFileInteractor>();
sendFileInteractor.execute(
room: room!,
fileInfos: [
FileInfo(shareFile!.name, shareFile!.filePath!, shareFile!.size),
],
);
}
});
}

@override
void didUpdateWidget(covariant Chat oldWidget) {
if (shareFile != null && room != null && shareFile!.filePath != null) {
final sendFileInteractor = getIt.get<SendFileInteractor>();
sendFileInteractor.execute(
room: room!,
fileInfos: [
FileInfo(shareFile!.name, shareFile!.filePath!, shareFile!.size),
],
);
}
super.didUpdateWidget(oldWidget);
}

void _askToAcceptInvitation() async {
if (room?.membership != Membership.invite) return;

Expand Down

0 comments on commit 77b57a4

Please sign in to comment.