Playground improvements

pull/3896/head
Henning Dieterichs 2023-04-06 16:30:30 +02:00
parent 20a8d5a651
commit e3b1a47554
No known key found for this signature in database
GPG Key ID: 771381EFFDB9EC06
2 changed files with 11 additions and 5 deletions

View File

@ -140,7 +140,7 @@ export class PlaygroundModel {
}
}
private readonly debouncer = new Debouncer(250);
private readonly debouncer = new Debouncer(700);
@observable
public isDirty = false;

View File

@ -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