fix: Race conditions when adding many library items (#10013)
* Fix for race condition when adding many library items * Remove unused import * Replace any with LibraryItem type * Fix comments on pr * Fix build errors * Fix hoisted variable * new mime type * duplicate before passing down to be sure * lint * fix tests * Remove unused import --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
@@ -192,6 +192,7 @@ const createLibraryUpdate = (
|
||||
class Library {
|
||||
/** latest libraryItems */
|
||||
private currLibraryItems: LibraryItems = [];
|
||||
|
||||
/** snapshot of library items since last onLibraryChange call */
|
||||
private prevLibraryItems = cloneLibraryItems(this.currLibraryItems);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { cleanAppStateForExport } from "../appState";
|
||||
import type {
|
||||
AppState,
|
||||
BinaryFiles,
|
||||
LibraryItem,
|
||||
LibraryItems,
|
||||
LibraryItems_anyVersion,
|
||||
} from "../types";
|
||||
@@ -59,3 +60,7 @@ export interface ImportedLibraryData extends Partial<ExportedLibraryData> {
|
||||
/** @deprecated v1 */
|
||||
library?: LibraryItems;
|
||||
}
|
||||
|
||||
export type ExcalidrawLibraryIds = {
|
||||
itemIds: LibraryItem["id"][];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user