This commit is contained in:
vcoppe
2026-10-04 11:07:12 +02:00
parent f458a1104f
commit 9015da4876
13 changed files with 122 additions and 19 deletions
@@ -85,7 +85,11 @@ export class SortableFileList {
this._unsubscribes.push(
engine.selection.subscribe(() => tick().then(() => this.updateFromSelection()))
);
this._unsubscribes.push(engine.order.subscribe(() => this.updateFromFileOrder()));
// after the elements are rendered: sorting a list that does not have the new files yet
// would put them at the beginning
this._unsubscribes.push(
engine.order.subscribe(() => tick().then(() => this.updateFromFileOrder()))
);
}
/** The node of a child of the list. */
+3 -2
View File
@@ -147,8 +147,9 @@ class Engine {
return this.run((w) => w.new_file(name));
}
loadFile(data: Uint8Array) {
return this.run((w) => w.load_file(data));
/** `name` is the name of the file when the data has none (the name on disk, without extension). */
loadFile(data: Uint8Array, name: string) {
return this.run((w) => w.load_file(data, name));
}
duplicate() {