mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 10:29:00 +02:00
fix(DialogCheckbox): prevent some potential issues in dialogcheckbox
This commit is contained in:
@@ -20,13 +20,14 @@ export interface DialogCheckboxProps extends DialogCommonProps, FooterLegendProp
|
||||
|
||||
// Do not access KeyDown, SetChecked, Toggle here as they are getters and accessing them outside of a render breaks them globally
|
||||
export const DialogCheckbox = findModuleExport(e =>
|
||||
e.prototype &&
|
||||
e?.prototype &&
|
||||
typeof e?.prototype == "object" &&
|
||||
"GetPanelElementProps" in e?.prototype &&
|
||||
"SetChecked" in e?.prototype &&
|
||||
"Toggle" in e?.prototype &&
|
||||
// beta || stable as of oct 2 2024
|
||||
(e?.prototype?.render?.toString().includes('="DialogCheckbox"') || (
|
||||
(e?.prototype?.render?.toString?.().includes('="DialogCheckbox"') || (
|
||||
e.contextType &&
|
||||
e.prototype?.render?.toString().includes('fallback:')
|
||||
e.prototype?.render?.toString?.().includes('fallback:')
|
||||
))
|
||||
) as FC<DialogCheckboxProps>;
|
||||
|
||||
Reference in New Issue
Block a user