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