parent
977f9228f8
commit
f8c611118e
1 changed files with 12 additions and 6 deletions
|
@ -7,6 +7,7 @@ import {
|
||||||
AppBskyGraphListitem,
|
AppBskyGraphListitem,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
import {Image as RNImage} from 'react-native-image-crop-picker'
|
import {Image as RNImage} from 'react-native-image-crop-picker'
|
||||||
|
import chunk from 'lodash.chunk'
|
||||||
import {RootStoreModel} from '../root-store'
|
import {RootStoreModel} from '../root-store'
|
||||||
import * as apilib from 'lib/api/index'
|
import * as apilib from 'lib/api/index'
|
||||||
import {cleanError} from 'lib/strings/errors'
|
import {cleanError} from 'lib/strings/errors'
|
||||||
|
@ -211,12 +212,17 @@ export class ListModel {
|
||||||
rkey: urip.rkey,
|
rkey: urip.rkey,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.rootStore.agent.com.atproto.repo.applyWrites({
|
const writes = records
|
||||||
repo: this.rootStore.me.did,
|
.map(record => createDel(record.uri))
|
||||||
writes: [createDel(this.uri)].concat(
|
.concat([createDel(this.uri)])
|
||||||
records.map(record => createDel(record.uri)),
|
|
||||||
),
|
// apply in chunks
|
||||||
})
|
for (const writesChunk of chunk(writes, 10)) {
|
||||||
|
await this.rootStore.agent.com.atproto.repo.applyWrites({
|
||||||
|
repo: this.rootStore.me.did,
|
||||||
|
writes: writesChunk,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.rootStore.emitListDeleted(this.uri)
|
this.rootStore.emitListDeleted(this.uri)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue