feat(navigation): enhance adult verification handling and notifications
- Updated navigationController to simplify the eroticChat menu structure. - Enhanced adminService to notify users of adult verification status changes, including previous status. - Improved AppNavigation and related components to register and unregister socket listeners for adult verification updates. - Added localized messages for adult verification notifications in English, German, and Spanish. - Introduced a verification hint in the EroticAccessView to guide users on document submission.
This commit is contained in:
@@ -35,6 +35,7 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { getAdultVerificationBaseDir, getLegacyAdultVerificationBaseDir } from '../utils/storagePaths.js';
|
||||
import { notifyUser } from '../utils/socket.js';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
@@ -385,6 +386,8 @@ class AdminService {
|
||||
where: { userId: user.id, paramTypeId: paramType.id }
|
||||
});
|
||||
|
||||
const previousStatus = existing?.value || 'none';
|
||||
|
||||
if (existing) {
|
||||
await existing.update({ value: status });
|
||||
} else {
|
||||
@@ -395,6 +398,12 @@ class AdminService {
|
||||
});
|
||||
}
|
||||
|
||||
await notifyUser(targetHashedId, 'reloadmenu', {});
|
||||
await notifyUser(targetHashedId, 'adultVerificationChanged', {
|
||||
status,
|
||||
previousStatus
|
||||
});
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user