Skip to content

Commit

Permalink
chore: holy types
Browse files Browse the repository at this point in the history
  • Loading branch information
yofukashino committed Jan 29, 2025
1 parent 133ebff commit b73b05e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/renderer/modules/common/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type DiscordComponents = {
| TextAreaType
| TextInputType
| OriginalTooltipType
| unknown
>;

export default await waitForProps<DiscordComponents>("ConfirmModal", "ToastPosition", "Text");
2 changes: 1 addition & 1 deletion src/renderer/modules/components/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const source = sourceStrings[rawMod?.id].matchAll(
/if\(\w+\.type===\w+\.(\w+)(?:\.\w+)?\).+?type:"(.+?)"/gs,
);

const menuComponents = Object.entries(components)
const menuComponents = Object.entries(components as Record<string, () => null>)
.filter(([_, m]) => /^function.+\(e?\){(\s+)?return null(\s+)?}$/.test(m?.toString?.()))
.reduce<Record<string, () => null>>((components, [name, component]) => {
components[name.substring(0, 2)] = component;
Expand Down

0 comments on commit b73b05e

Please sign in to comment.