bounds management

This commit is contained in:
vcoppe
2025-10-19 16:14:05 +02:00
parent 117c46341b
commit e57ced0ce7
12 changed files with 258 additions and 182 deletions

View File

@@ -261,15 +261,17 @@ export class SelectedGPXFilesObserver {
constructor(onSelectedFileChange: () => void) {
this._unsubscribes = new Map();
this._fileStateCollectionObserver = new GPXFileStateCollectionObserver(
(fileId, fileState) => {
this._unsubscribes.set(
fileId,
fileState.subscribe(() => {
if (get(selection).hasAnyChildren(new ListFileItem(fileId))) {
onSelectedFileChange();
}
})
);
(newFiles) => {
newFiles.forEach((fileState, fileId) => {
this._unsubscribes.set(
fileId,
fileState.subscribe(() => {
if (get(selection).hasAnyChildren(new ListFileItem(fileId))) {
onSelectedFileChange();
}
})
);
});
},
(fileId) => {
this._unsubscribes.get(fileId)?.();