Skip to content

Commit

Permalink
refactor(layermanager): Use options object for sortByZ folder function
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipLeitner committed Oct 20, 2024
1 parent b71c139 commit 843b408
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class HsLayerFolderWidgetComponent extends HsLayerEditorWidgetBaseCompone
this.folderService.folderAction$.next(
this.folderService.addLayer(this.hsLayerSelectorService.currentLayer),
);
this.folderService.folderAction$.next(this.folderService.sortByZ(false));
this.folderService.folderAction$.next(
this.folderService.sortByZ({debounce: false}),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class HsLayerManagerFolderService {
private hsConfig: HsConfig,
) {
this.sortSubject.pipe(debounceTime(this.sortDebounceTime)).subscribe(() => {
this.folderAction$.next(this.sortByZ(false));
this.folderAction$.next(this.sortByZ({debounce: false}));
});
}

Expand Down Expand Up @@ -104,11 +104,11 @@ export class HsLayerManagerFolderService {
};
}

sortByZ(debounce = true): SortFoldersByZAction {
sortByZ(options = {debounce: true}): SortFoldersByZAction {
return {
type: FolderActionTypes.SORT_BY_Z,
lyr: undefined,
debounce: debounce,
debounce: options.debounce,
};
}

Expand Down

0 comments on commit 843b408

Please sign in to comment.