This commit fixes an issue where the check state of categories was lost when toggling between card and tree views. This is solved by immediately emitting node state changes for all nodes. This ensures consistent view transitions without any loss of node state information. Furthermore, this commit includes added unit tests for the modified code sections.
20 lines
627 B
TypeScript
20 lines
627 B
TypeScript
import { DelayScheduler } from '@/presentation/components/Scripts/View/Tree/TreeView/Rendering/DelayScheduler';
|
|
|
|
export class DelaySchedulerStub implements DelayScheduler {
|
|
public nextCallback: () => void | undefined = undefined;
|
|
|
|
public scheduleNext(callback: () => void): void {
|
|
this.nextCallback = callback;
|
|
}
|
|
|
|
public runNextScheduled(): void {
|
|
if (!this.nextCallback) {
|
|
throw new Error('no callback is scheduled');
|
|
}
|
|
// Store the callback to prevent changes to this.nextCallback during execution
|
|
const callback = this.nextCallback;
|
|
this.nextCallback = undefined;
|
|
callback();
|
|
}
|
|
}
|