Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions lib/controllers/pair_chat_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,26 @@ class PairChatController extends GetxController {
Get.toNamed(AppRoutes.pairChat);
}

Future<void> cancelRequest() async {
await tablesDB.deleteRow(
databaseId: masterDatabaseId,
tableId: pairRequestTableId,
rowId: requestDocId!,
);
subscription?.close();
userAddedSubscription?.close();
Future<void> cancelRequest() async {
try {
if (requestDocId != null) {
await tablesDB.deleteRow(
databaseId: masterDatabaseId,
tableId: pairRequestTableId,
rowId: requestDocId!,
);
}

requestDocId = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why set the requestDocId to null?

Copy link
Author

@Rozerxshashank Rozerxshashank Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set to null beacuse if app keeps the old requestDocId it may try to cancel the same request again. (Like when button tapped twice)
It just avoids accidental reuse of an invalid ID and reset the controlller to a complete clean state.


await subscription?.close();
await userAddedSubscription?.close();
} catch (e) {
log('Cancel request failed: $e');
} finally {
Get.offNamedUntil(AppRoutes.tabview, (route) => false);
}

}
void toggleMic() async {
isMicOn.value = !isMicOn.value;
await Get.find<LiveKitController>().liveKitRoom.localParticipant
Expand Down