contactdata
This commit is contained in:
@@ -42,13 +42,14 @@ export class ContactsDataService {
|
||||
raw_contacts : string
|
||||
mmode: number,
|
||||
csize:number,
|
||||
pcount: number
|
||||
pcount: number,
|
||||
part_lenght:number
|
||||
};
|
||||
pPesult:any;
|
||||
async cacheContactsForAccount(contactResult){
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Refresing...',
|
||||
message: 'Refreshing...',
|
||||
duration: 7000,
|
||||
});
|
||||
const myString = JSON.stringify(contactResult.contacts);
|
||||
@@ -56,15 +57,25 @@ export class ContactsDataService {
|
||||
// alert(myString);
|
||||
await loading.present();
|
||||
const chunkSize = 3000;
|
||||
for(let ic=0; ic< myString.length; ic=ic+chunkSize){
|
||||
var chunkArray =[];
|
||||
var count_l=0;
|
||||
for(let ic=0; ic<= myString.length; ic=ic+chunkSize){
|
||||
chunkArray[count_l]= myString.substring(ic,ic+chunkSize);
|
||||
count_l=count_l+1;
|
||||
}
|
||||
|
||||
|
||||
for(let ic=0; ic<count_l; ic=ic+1){
|
||||
// for(let ic=0; ic< myString.length; ic=ic+chunkSize){
|
||||
this.usrData = {action:22010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
raw_contacts: myString.substring(ic,ic+chunkSize),
|
||||
mmode: ic,
|
||||
csize: chunkSize,
|
||||
pcount: myString.length
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
raw_contacts: chunkArray[ic], /* myString.substring(ic,ic+chunkSize)*/
|
||||
mmode: ic,
|
||||
csize: chunkSize,
|
||||
pcount: myString.length,
|
||||
part_lenght: count_l
|
||||
}
|
||||
|
||||
await this.wrenchService.processUsersContacts(this.usrData).subscribe(
|
||||
|
||||
Reference in New Issue
Block a user