web: more fixes

This commit is contained in:
Abdullah Atta
2023-12-22 08:21:46 +05:00
parent 7b3f671159
commit 36150fb55b
15 changed files with 96 additions and 81 deletions

View File

@@ -226,6 +226,10 @@ export class Notebooks implements ICollection {
return notebook;
}
find(title: string) {
return this.all.find((eb) => eb("notebooks.title", "==", title));
}
exists(id: string) {
return this.collection.exists(id);
}

View File

@@ -28,8 +28,7 @@ type Batch<T> = {
export class VirtualizedGrouping<T> {
private cache: Map<number, Batch<T>> = new Map();
private pending: Map<number, Promise<Batch<T>>> = new Map();
public ids: number[];
private loadBatchTimeout?: number;
public ids: boolean[];
constructor(
count: number,
@@ -43,7 +42,7 @@ export class VirtualizedGrouping<T> {
) => Map<number, { index: number; hidden?: boolean; group: GroupHeader }>,
readonly groups?: () => Promise<{ index: number; group: GroupHeader }[]>
) {
this.ids = new Array(count).fill(0);
this.ids = new Array(count).fill(false);
}
key(index: number) {
@@ -95,14 +94,6 @@ export class VirtualizedGrouping<T> {
};
}
/**
* Reload the cache
*/
refresh(ids: number[]) {
this.ids = ids;
this.cache.clear();
}
/**
*
* @param index