Skip to content

Commit

Permalink
Fix issue in demo name
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Feb 1, 2024
1 parent bd4e84a commit c3bbdc1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [0.0.17] - 2024-02-01

- Sort demo files by name
- Fix issue where demos with the same name were all check when executed

## [0.0.16] - 2024-02-01

- Move order of open command to be able to open binary files
Expand Down
23 changes: 21 additions & 2 deletions src/panels/DemoPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,33 @@ export class DemoPanel {
return;
}

let demoKeys = Object.keys(demoFiles);
demoKeys = demoKeys.sort((aPath, bPath) => {
aPath = aPath.toLowerCase();
bPath = bPath.toLowerCase();

if (aPath < bPath) {
return -1;
}

if (aPath > bPath) {
return 1;
}

return 0;
});

const accountCommands: ActionTreeItem[] = [];

for (const path of Object.keys(demoFiles)) {
for (const path of demoKeys) {
const demos = (demoFiles as any)[path] as Demos;
const executingFile = await DemoRunner.getExecutedDemoFile();

const demoSteps = demos.demos.map((demo, idx, allDemos) => {
const hasExecuted = executingFile.demo.find((d) => d.title === demo.title);
let hasExecuted = false;
if (executingFile.filePath === path) {
hasExecuted = !!executingFile.demo.find((d) => d.title === demo.title);
}

let ctxValue = "demo-time.step";
if (idx === 0) {
Expand Down

0 comments on commit c3bbdc1

Please sign in to comment.