mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 01:26:37 +08:00
feat(core): delete all readwise highlights when disconnect (#10975)
close AF-2306
This commit is contained in:
@@ -224,6 +224,23 @@ export class ReadwiseIntegration extends Entity<{ writer: IntegrationWriter }> {
|
||||
token: undefined,
|
||||
updateStrategy: undefined,
|
||||
syncNewHighlights: undefined,
|
||||
lastImportedAt: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all highlights of current user in current workspace
|
||||
*/
|
||||
async deleteAll() {
|
||||
const refs = await this.getRefs();
|
||||
await Promise.all(
|
||||
refs.map(ref => {
|
||||
const doc = this.docsService.list.doc$(ref.id).value;
|
||||
if (doc) {
|
||||
doc.moveToTrash();
|
||||
}
|
||||
return this.integrationRefStore.deleteRef(ref.id);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user