From 9128c1e7dadb98a8926d3dba9907a01cc78d90cf Mon Sep 17 00:00:00 2001 From: Travis Lane <63308171+Tormak9970@users.noreply.github.com> Date: Mon, 26 Jun 2023 11:29:21 -0500 Subject: [PATCH 1/4] fix: add patch indicator to prevent crashes (#88) --- src/utils/react.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/utils/react.ts b/src/utils/react.ts index 2971364..04b2c6f 100644 --- a/src/utils/react.ts +++ b/src/utils/react.ts @@ -46,13 +46,21 @@ export function fakeRenderComponent(fun: Function, customHooks: any = {}): any { } export function wrapReactType(node: any, prop: any = 'type') { - return (node[prop] = { ...node[prop] }); + if (node[prop]?.__DECKY_WRAPPED) { + return node[prop]; + } else { + return (node[prop] = { ...node[prop], __DECKY_WRAPPED: true }); + } } export function wrapReactClass(node: any, prop: any = 'type') { - const cls = node[prop]; - const wrappedCls = class extends cls {}; - return (node[prop] = wrappedCls); + if (node[prop]?.__DECKY_WRAPPED) { + return node[prop]; + } else { + const cls = node[prop]; + const wrappedCls = class extends cls { static __DECKY_WRAPPED = true; }; + return (node[prop] = wrappedCls); + } } export function getReactInstance(o: HTMLElement | Element | Node) { From c213204ff40c9b3904249ec0a36ac805ae04dfb2 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 26 Jun 2023 16:30:09 +0000 Subject: [PATCH 2/4] chore(release): 3.21.7 [CI SKIP] --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85e4dfe..47ce3db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [3.21.7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.6...v3.21.7) (2023-06-26) + + +### Bug Fixes + +* add patch indicator to prevent crashes ([#88](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/88)) ([9128c1e](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/9128c1e7dadb98a8926d3dba9907a01cc78d90cf)) + ## [3.21.6](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.5...v3.21.6) (2023-06-22) diff --git a/package.json b/package.json index 1d6ea6e..227e155 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decky-frontend-lib", - "version": "3.21.6", + "version": "3.21.7", "description": "A library for building decky plugins", "main": "dist/index.js", "types": "dist/index.d.ts", From c9b583945c1cb5267b41a821743590a841572abe Mon Sep 17 00:00:00 2001 From: Marco Rodolfi Date: Tue, 27 Jun 2023 15:38:04 +0200 Subject: [PATCH 3/4] fix: the typescript compiler was eating the enum If not defined with a const keyword --- src/plugin.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin.tsx b/src/plugin.tsx index ad8fa0d..50b2021 100644 --- a/src/plugin.tsx +++ b/src/plugin.tsx @@ -57,7 +57,7 @@ export interface FilePickerRes { realpath: string; } -export enum FileSelectionType { +export const enum FileSelectionType { FILE, FOLDER, } From 1ff9351f96bc9e78683b69feff72a20389fec929 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 27 Jun 2023 13:38:46 +0000 Subject: [PATCH 4/4] chore(release): 3.21.8 [CI SKIP] --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47ce3db..1877fc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [3.21.8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.7...v3.21.8) (2023-06-27) + + +### Bug Fixes + +* the typescript compiler was eating the enum ([c9b5839](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/c9b583945c1cb5267b41a821743590a841572abe)) + ## [3.21.7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.6...v3.21.7) (2023-06-26) diff --git a/package.json b/package.json index 227e155..6c6af59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decky-frontend-lib", - "version": "3.21.7", + "version": "3.21.8", "description": "A library for building decky plugins", "main": "dist/index.js", "types": "dist/index.d.ts",