@xuda.io/account_module 1.2.1652 → 1.2.1654
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.
- package/index.mjs +4 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2035,6 +2035,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2035
2035
|
limit: 1,
|
|
2036
2036
|
fields: ['_id'],
|
|
2037
2037
|
};
|
|
2038
|
+
debugger;
|
|
2038
2039
|
const user_contacts = await find_contact_query(uid, opt);
|
|
2039
2040
|
if (user_contacts.docs.length) {
|
|
2040
2041
|
// throw new Error('contact already exist');
|
|
@@ -2141,7 +2142,6 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2141
2142
|
};
|
|
2142
2143
|
|
|
2143
2144
|
const set_contact_profile_picture = async function (uid, contact_id, metadata, job_id, headers) {
|
|
2144
|
-
|
|
2145
2145
|
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
2146
2146
|
const account_profile_info = await get_active_account_profile_info(uid);
|
|
2147
2147
|
|
|
@@ -2234,7 +2234,7 @@ const update_account_profile_picture_status = async function (uid, stat, error)
|
|
|
2234
2234
|
let doc = await db_module.get_couch_doc_native('xuda_accounts', uid);
|
|
2235
2235
|
doc.account_info.profile_avatar_stat = stat;
|
|
2236
2236
|
doc.account_info.profile_avatar_error = error;
|
|
2237
|
-
doc.account_info.profile_avatar_stat_ts=Date.now()
|
|
2237
|
+
doc.account_info.profile_avatar_stat_ts = Date.now();
|
|
2238
2238
|
const save_ret = await db_module.save_couch_doc_native('xuda_accounts', doc);
|
|
2239
2239
|
} catch (err) {
|
|
2240
2240
|
console.error(err);
|
|
@@ -2247,7 +2247,7 @@ const update_contact_profile_picture_status = async function (uid, contact_id, s
|
|
|
2247
2247
|
let doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, contact_id);
|
|
2248
2248
|
doc.profile_avatar_stat = stat;
|
|
2249
2249
|
doc.profile_avatar_error = error;
|
|
2250
|
-
doc.profile_avatar_stat_ts=Date.now()
|
|
2250
|
+
doc.profile_avatar_stat_ts = Date.now();
|
|
2251
2251
|
|
|
2252
2252
|
const save_ret = await db_module.save_app_couch_doc_native(account_profile_info.app_id, doc);
|
|
2253
2253
|
} catch (err) {
|
|
@@ -2378,8 +2378,7 @@ export const get_contacts = async function (req, job_id, headers) {
|
|
|
2378
2378
|
contact_docs.docs.push(doc);
|
|
2379
2379
|
|
|
2380
2380
|
if (contact_id) {
|
|
2381
|
-
|
|
2382
|
-
if (!doc.profile_avatar && (!doc.profile_avatar_stat || doc.profile_avatar_stat === 1 || (doc.profile_avatar_stat === 2 && (!doc.profile_avatar_stat_ts || Date.now()-doc.profile_avatar_stat_ts>1000*60*5))) {
|
|
2381
|
+
if (!doc.profile_avatar && (!doc.profile_avatar_stat || doc.profile_avatar_stat === 1 || (doc.profile_avatar_stat === 2 && (!doc.profile_avatar_stat_ts || Date.now() - doc.profile_avatar_stat_ts > 1000 * 60 * 5)))) {
|
|
2383
2382
|
set_contact_profile_picture(uid, doc._id, {}, job_id, headers);
|
|
2384
2383
|
}
|
|
2385
2384
|
}
|