chore: add error handling for creating direct messages

This commit is contained in:
GleidsonDaniel 2024-02-27 14:20:10 -03:00
parent f3389100ae
commit b4218a1263
1 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import appNavigation from '../../lib/navigation/appNavigation';
import { Services } from '../../lib/services';
import database from '../../lib/database';
import { RoomTypes } from '../../lib/methods';
import { emitErrorCreateDirectMessage } from '../../lib/methods/helpers/emitErrorCreateDirectMessage';
export type TRoomType = SubscriptionType.CHANNEL | SubscriptionType.GROUP | SubscriptionType.OMNICHANNEL;
@ -89,8 +90,8 @@ export const navToDirectMessage = async (item: IUser, isMasterDetail: boolean):
handleGoRoom({ rid: result.room?._id as string, name: item.username, t: SubscriptionType.DIRECT }, isMasterDetail);
}
}
} catch (e) {
log(e);
} catch (e: any) {
emitErrorCreateDirectMessage(e?.data);
}
};