Skip to content

Commit

Permalink
fix log adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Jul 31, 2024
1 parent 0984b8b commit f5ee158
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions apps/color-buddy/src/linting/EvalResponse.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@
function proposeFix(fixType: "ai" | "monte" | "heuristic") {
requestState = "loading";
let hasRetried = false;
logEvent(
"lint-fix",
{
fixType,
errorName: lintProgram.name,
lintProgram: lintProgram.program,
palette: palette.colors.map((x) => x.toDisplay()),
background: palette.background.toDisplay(),
},
$configStore.userName
);
const getFix = () => {
let fix;
if (fixType === "ai") {
Expand All @@ -53,6 +42,18 @@
return fix.then((x) => {
suggestions = [...suggestions, ...x];
requestState = "loaded";
logEvent(
"lint-fix",
{
fixType,
errorName: lintProgram.name,
lintProgram: lintProgram.program,
palette: palette.colors.map((x) => x.toDisplay()),
background: palette.background.toDisplay(),
fix: x.map((y) => y.colors.map((z) => z.toDisplay())),
},
$configStore.userName
);
});
};
Expand Down Expand Up @@ -124,7 +125,7 @@
Try to fix (AI)
</button>
{/if}
{#if lintProgram.subscribedFix !== "none"}
{#if lintProgram.subscribedFix && lintProgram.subscribedFix !== "none"}
<button class={buttonStyle} on:click={() => proposeFix("heuristic")}>
Try to fix (ColorBuddy)
</button>
Expand Down

0 comments on commit f5ee158

Please sign in to comment.