mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: filter notification with id
This commit is contained in:
@ -26,7 +26,7 @@ export const TestCreateGrid = () => {
|
|||||||
},
|
},
|
||||||
onRowsChanged: async (rows) => {
|
onRowsChanged: async (rows) => {
|
||||||
if (rows.length !== 3) {
|
if (rows.length !== 3) {
|
||||||
throw Error('Expected number of rows is 3, but receive ' + rows.length);
|
throw Error('Expected number of rows is 3, but receive ' + rows.length + view.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFieldsChanged: (fields) => {
|
onFieldsChanged: (fields) => {
|
||||||
@ -36,6 +36,7 @@ export const TestCreateGrid = () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
await databaseController.open().then((result) => result.unwrap());
|
await databaseController.open().then((result) => result.unwrap());
|
||||||
|
await databaseController.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
return TestButton('Test create build-in grid', createBuildInGrid);
|
return TestButton('Test create build-in grid', createBuildInGrid);
|
||||||
|
@ -15,7 +15,6 @@ export class CellCache {
|
|||||||
remove = (key: CellCacheKey) => {
|
remove = (key: CellCacheKey) => {
|
||||||
const cellDataByRowId = this.cellDataByFieldId.get(key.fieldId);
|
const cellDataByRowId = this.cellDataByFieldId.get(key.fieldId);
|
||||||
if (cellDataByRowId !== undefined) {
|
if (cellDataByRowId !== undefined) {
|
||||||
console.log('cellDataByRowId', cellDataByRowId);
|
|
||||||
cellDataByRowId.delete(key.rowId);
|
cellDataByRowId.delete(key.rowId);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { listen, UnlistenFn } from '@tauri-apps/api/event';
|
import { listen, UnlistenFn } from "@tauri-apps/api/event";
|
||||||
import { SubscribeObject } from '../models/flowy-notification';
|
import { SubscribeObject } from "../models/flowy-notification";
|
||||||
import { NotificationParser } from './parser';
|
import { NotificationParser } from "./parser";
|
||||||
|
|
||||||
export abstract class AFNotificationObserver<T> {
|
export abstract class AFNotificationObserver<T> {
|
||||||
parser?: NotificationParser<T> | null;
|
parser?: NotificationParser<T> | null;
|
||||||
@ -11,9 +11,15 @@ export abstract class AFNotificationObserver<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
this._listener = await listen('af-notification', (notification) => {
|
this._listener = await listen("af-notification", (notification) => {
|
||||||
const object = SubscribeObject.fromObject(notification.payload as {});
|
const object: SubscribeObject = SubscribeObject.fromObject(notification.payload as {});
|
||||||
this.parser?.parse(object);
|
if (this.parser?.id !== undefined) {
|
||||||
|
if (object.id === this.parser.id) {
|
||||||
|
this.parser?.parse(object);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.parser?.parse(object);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user