fix(plugin-data-source-main): fix changed api

This commit is contained in:
mytharcher 2024-07-31 15:15:07 +00:00
parent b61895d309
commit 288823dab1

View File

@ -41,7 +41,7 @@ export class PluginDataSourceMainServer extends Plugin {
this.loadFilter = filter;
}
async onSync(message) {
async handleSyncMessage(message) {
const { type, collectionName } = message;
if (type === 'newCollection') {
const collectionModel: CollectionModel = await this.app.db.getCollection('collections').repository.findOne({
@ -92,7 +92,7 @@ export class PluginDataSourceMainServer extends Plugin {
transaction,
});
this.app.syncManager.publish(this.name, {
this.sendSyncMessage({
type: 'newCollection',
collectionName: model.get('name'),
});