Skip to content

Commit

Permalink
Merge pull request #3896 from microsoft/hediet/b/vicarious-sloth
Browse files Browse the repository at this point in the history
Playground improvements
  • Loading branch information
hediet authored Apr 6, 2023
2 parents 20a8d5a + e3b1a47 commit af0106a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion website/src/website/pages/playground/PlaygroundModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class PlaygroundModel {
}
}

private readonly debouncer = new Debouncer(250);
private readonly debouncer = new Debouncer(700);

@observable
public isDirty = false;
Expand Down
14 changes: 10 additions & 4 deletions website/src/website/pages/playground/PlaygroundPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,16 @@ export class PlaygroundPageContent extends React.Component<
checked={
model.settings.autoReload
}
onChange={(e) =>
(model.settings.autoReload =
e.target.checked)
}
onChange={(e) => {
model.settings.autoReload =
e.target.checked;
if (
e.target.checked &&
model.isDirty
) {
model.reload();
}
}}
/>
)}
<Button
Expand Down

0 comments on commit af0106a

Please sign in to comment.