Skip to content

Commit

Permalink
fix(playground): rename reset to clear (#10806)
Browse files Browse the repository at this point in the history
feat(playground): rename reset to clear

Reset is confusing when coming from a live sample.
So we rename it to clear for now.

Resolves  #10733
  • Loading branch information
fiji-flo committed Apr 3, 2024
1 parent acc3363 commit 54ad381
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions client/src/playground/index.tsx
Expand Up @@ -158,7 +158,7 @@ export default function Playground() {
window.removeEventListener("message", messageListener);
};
}, [messageListener]);
const reset = async () => {
const clear = async () => {
setSearchParams([], { replace: true });
setCodeSrc(undefined);
htmlRef.current?.setContent(HTML_DEFAULT);
Expand All @@ -167,10 +167,10 @@ export default function Playground() {

updateWithEditorContent();
};
const resetConfirm = async () => {
if (window.confirm("Do you really want to reset everything?")) {
const clearConfirm = async () => {
if (window.confirm("Do you really want to clear everything?")) {
gleanClick(`${PLAYGROUND}: reset-click`);
await reset();
await clear();
}
};

Expand Down Expand Up @@ -287,11 +287,11 @@ export default function Playground() {
</Button>
<Button
type="secondary"
id="reset"
id="clear"
extraClasses="red"
onClickHandler={resetConfirm}
onClickHandler={clearConfirm}
>
reset
clear
</Button>
</menu>
</aside>
Expand Down

0 comments on commit 54ad381

Please sign in to comment.