Refactor backend CORS settings to include default origins and improve error handling in chat services: Introduce dynamic CORS origin handling, enhance RabbitMQ message sending with fallback mechanisms, and update WebSocket service to manage pending messages. Update UI components for better accessibility and responsiveness, including adjustments to dialog and navigation elements. Enhance styling for improved user experience across various components.
This commit is contained in:
@@ -389,6 +389,8 @@ class FalukantService extends BaseService {
|
||||
one: { min: 50, max: 5000 },
|
||||
all: { min: 400, max: 40000 }
|
||||
};
|
||||
static WOOING_PROGRESS_TARGET = 70;
|
||||
static WOOING_GIFT_COOLDOWN_MS = 30 * 60 * 1000;
|
||||
static HEALTH_ACTIVITIES = [
|
||||
{ tr: "barber", method: "healthBarber", cost: 10 },
|
||||
{ tr: "doctor", method: "healthDoctor", cost: 50 },
|
||||
@@ -3311,8 +3313,8 @@ class FalukantService extends BaseService {
|
||||
order: [['createdAt', 'DESC']],
|
||||
limit: 1
|
||||
});
|
||||
if (lastGift && (lastGift.createdAt.getTime() + 3_600_000) > Date.now()) {
|
||||
const retryAt = new Date(lastGift.createdAt.getTime() + 3_600_000);
|
||||
if (lastGift && (lastGift.createdAt.getTime() + FalukantService.WOOING_GIFT_COOLDOWN_MS) > Date.now()) {
|
||||
const retryAt = new Date(lastGift.createdAt.getTime() + FalukantService.WOOING_GIFT_COOLDOWN_MS);
|
||||
const err = new PreconditionError('tooOften');
|
||||
err.meta = { retryAt: retryAt.toISOString() };
|
||||
throw err;
|
||||
@@ -3381,7 +3383,7 @@ class FalukantService extends BaseService {
|
||||
|
||||
async checkProposalProgress(relation) {
|
||||
const { nextStepProgress } = relation;
|
||||
if (nextStepProgress >= 100) {
|
||||
if (nextStepProgress >= FalukantService.WOOING_PROGRESS_TARGET) {
|
||||
const engagedStatus = await RelationshipType.findOne({ where: { tr: 'engaged' } });
|
||||
await relation.update({ nextStepProgress: 0, relationshipTypeId: engagedStatus.id });
|
||||
const user = await User.findOne({
|
||||
|
||||
Reference in New Issue
Block a user