@xuda.io/account_module 1.2.460 → 1.2.462

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +29 -29
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1199,31 +1199,30 @@ const get_contact_background = function (doc) {
1199
1199
  const get_contact_pattern = function (doc) {
1200
1200
  const ret = `default-pattern.png`;
1201
1201
 
1202
- if (doc.pending) {
1203
- ret = `linear-gradient(145deg, #4f4f4f8c 0%, #0e0f0f44 100%);`;
1204
- }
1205
-
1206
- switch (doc.contact_mood) {
1207
- case -2: {
1208
- ret = `linear-gradient(145deg, #f60404d8 0%, #7f98e344 100%)`;
1209
- break;
1210
- }
1211
- case -1: {
1212
- ret = `linear-gradient(145deg, #f6040452 0%, #7f98e344 100%)`;
1213
- break;
1214
- }
1215
- case 1: {
1216
- ret = `linear-gradient(145deg, #04f61452 0%, #7f98e344 100%)`;
1217
- break;
1218
- }
1219
- case 2: {
1220
- ret = `linear-gradient(145deg, #30f604c9 0%, #7f98e344 100%)`;
1221
- break;
1202
+ if (doc.contact_uid) {
1203
+ ret = `xu-pattern.png`;
1204
+ } else {
1205
+ switch (doc.contact_mood) {
1206
+ case -2: {
1207
+ ret = `linear-gradient(145deg, #f60404d8 0%, #7f98e344 100%)`;
1208
+ break;
1209
+ }
1210
+ case -1: {
1211
+ ret = `linear-gradient(145deg, #f6040452 0%, #7f98e344 100%)`;
1212
+ break;
1213
+ }
1214
+ case 1: {
1215
+ ret = `linear-gradient(145deg, #04f61452 0%, #7f98e344 100%)`;
1216
+ break;
1217
+ }
1218
+ case 2: {
1219
+ ret = `linear-gradient(145deg, #30f604c9 0%, #7f98e344 100%)`;
1220
+ break;
1221
+ }
1222
+ default:
1223
+ break;
1222
1224
  }
1223
- default:
1224
- break;
1225
1225
  }
1226
-
1227
1226
  return ret;
1228
1227
  };
1229
1228
 
@@ -1293,13 +1292,12 @@ export const get_contacts = async function (req) {
1293
1292
  doc.profile_avatar = account_ret.data.profile_avatar;
1294
1293
 
1295
1294
  doc.card_background = get_contact_background(doc);
1296
- doc.icon_pattern = `xu-pattern.png`;
1295
+
1297
1296
  // doc.telephone = `561-235-1675`;
1298
- if (doc.contact_uid === '0489f946c213947316647b468f029ed9') {
1299
- doc.notifications = 45;
1300
- doc.online = true;
1301
- doc.icon_pattern = `default-pattern.png`;
1302
- }
1297
+
1298
+ // doc.notifications = 45;
1299
+ // doc.online = true;
1300
+ doc.icon_pattern = get_contact_pattern(doc);
1303
1301
  }
1304
1302
  }
1305
1303
 
@@ -1322,6 +1320,7 @@ export const get_contacts = async function (req) {
1322
1320
  continue; // throw new Error(`account ${contact_uid} not found`);
1323
1321
  }
1324
1322
  doc.profile_avatar = account_ret.data.profile_avatar;
1323
+ doc.icon_pattern = get_contact_pattern(doc);
1325
1324
  doc.name = `${account_ret.data.first_name} ${account_ret.data.last_name}`;
1326
1325
  }
1327
1326
  doc.card_background = get_contact_background({ pending: true });
@@ -1343,6 +1342,7 @@ export const get_contacts = async function (req) {
1343
1342
  doc.name = `${account_ret.data.first_name} ${account_ret.data.last_name}`;
1344
1343
  }
1345
1344
  doc.card_background = get_contact_background({ pending: true });
1345
+ doc.icon_pattern = get_contact_pattern(doc);
1346
1346
  requests_from.docs.push(doc);
1347
1347
  }
1348
1348
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.460",
3
+ "version": "1.2.462",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {