more message match improvements

- new/updated messages from fcm are ignored while the app is alive since socket will handle them
This commit is contained in:
zlshames
2024-08-12 12:22:48 -04:00
parent 15155108ad
commit 4e91f48448
4 changed files with 62 additions and 16 deletions

View File

@ -60,6 +60,13 @@ class MethodChannelService extends GetxService {
case "new-message":
await storeStartup.future;
Logger.info("Received new message from MethodChannel");
// The socket will handle this event if the app is alive
if (ls.isAlive) {
Logger.debug("App is alive, ignoring new message...");
return true;
}
try {
Map<String, dynamic>? data = arguments;
if (!isNullOrEmpty(data)) {
@ -80,6 +87,13 @@ class MethodChannelService extends GetxService {
case "updated-message":
await storeStartup.future;
Logger.info("Received updated message from FCM");
// The socket will handle this event if the app is alive
if (ls.isAlive) {
Logger.debug("App is alive, ignoring updated message...");
return true;
}
try {
Map<String, dynamic>? data = arguments;
if (!isNullOrEmpty(data)) {