Skip to content

Commit

Permalink
Oops, missed committing some things.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Dec 6, 2024
1 parent 96b68ed commit 9f056f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
29 changes: 0 additions & 29 deletions packages/perseus/src/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1751,35 +1751,6 @@ class Renderer
return [totalGuess, totalScore];
};

examples: () => ReadonlyArray<string> | null | undefined = () => {
const widgetIds = this.widgetIds;
const examples = widgetIds
.map((widgetId) => {
const widget = this.getWidgetInstance(widgetId);
return widget != null && widget.examples
? widget.examples()
: null;
})
.filter(Boolean);

// no widgets with examples
if (!examples.length) {
return null;
}

const allEqual = _.all(examples, function (example) {
return _.isEqual(examples[0], example);
});

// some widgets have different examples
// TODO(alex): handle this better
if (!allEqual) {
return null;
}

return examples[0];
};

// TranslationLinter callback
handletranslationLintErrors: (lintErrors: ReadonlyArray<string>) => void = (
lintErrors: ReadonlyArray<string>,
Expand Down
1 change: 0 additions & 1 deletion packages/perseus/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export interface Widget {
getUserInput?: () => UserInputArray | UserInput | undefined;

showRationalesForCurrentlySelectedChoices?: (options?: any) => void;
examples?: () => ReadonlyArray<string>;
getPromptJSON?: () => WidgetPromptJSON;
}

Expand Down

0 comments on commit 9f056f0

Please sign in to comment.