summaryrefslogtreecommitdiff
path: root/frontend/src/components/settings/pages/general/Updater.tsx
diff options
context:
space:
mode:
authorbotato <63275405+botatooo@users.noreply.github.com>2022-08-27 00:01:23 -0400
committerGitHub <noreply@github.com>2022-08-26 21:01:23 -0700
commitb7d7ca04e12690b5e65259c8806e5e895cdc16aa (patch)
tree4cca1b72b69622e536dbb1ba13656d39a9420685 /frontend/src/components/settings/pages/general/Updater.tsx
parentd4d1c2bbabfcec3c62767e614c9d67f516938af2 (diff)
downloaddecky-loader-b7d7ca04e12690b5e65259c8806e5e895cdc16aa.tar.gz
decky-loader-b7d7ca04e12690b5e65259c8806e5e895cdc16aa.zip
Refractor plugin backend (#111)v2.0.5-pre18
* refractor uninstall plugin backend * refractor plugin installation method * Change formatting in browser.py * Manually format main.py * Manually format utilities.py * remove inconsistency * remove unnecessary linebreaks * lol what * last minute pythoning * Fix async missing * lint * more refractor * await forgotten * fix: menu not disappearing after first click * lint * bug: fix double click on uninstall * depricate request installs * basic patch notes viewer, lazy-load settings and store, build frontend as esmodule, add lazy-loaded react-markdown, backend changes to accomodate ESModule frontend * refractor uninstall plugin backend * Change formatting in browser.py * Manually format main.py * Manually format utilities.py * remove unnecessary linebreaks * lol what * last minute pythoning * Fix async missing * rebase onto main * fix error, fix React crash if patch notes are opened before remote version info is loaded Co-authored-by: TrainDoctor <traindoctor@protonmail.com> Co-authored-by: AAGaming <aa@mail.catvibers.me>
Diffstat (limited to 'frontend/src/components/settings/pages/general/Updater.tsx')
-rw-r--r--frontend/src/components/settings/pages/general/Updater.tsx64
1 files changed, 28 insertions, 36 deletions
diff --git a/frontend/src/components/settings/pages/general/Updater.tsx b/frontend/src/components/settings/pages/general/Updater.tsx
index cb58b24c..9635162c 100644
--- a/frontend/src/components/settings/pages/general/Updater.tsx
+++ b/frontend/src/components/settings/pages/general/Updater.tsx
@@ -17,46 +17,38 @@ function PatchNotesModal({ versionInfo, closeModal }: { versionInfo: VerInfo | n
return (
<Focusable onCancelButton={closeModal}>
<Carousel
- fnItemRenderer={(id: number, ...args: any[]) => {
- console.log(args, versionInfo);
- return (
- <Focusable
- onActivate={() => {}}
- style={{
- marginTop: '40px',
- height: 'calc( 100% - 40px )',
- overflowY: 'scroll',
- display: 'flex',
- justifyContent: 'center',
- margin: '40px',
- }}
- >
- <div>
- <h1>{versionInfo?.all?.[id]?.name}</h1>
- {versionInfo?.all?.[id]?.body ? (
- <Suspense fallback={<Spinner style={{ width: '24', height: '24' }} />}>
- <MarkdownRenderer>{versionInfo.all[id].body}</MarkdownRenderer>
- </Suspense>
- ) : (
- 'no patch notes for this version'
- )}
- </div>
- </Focusable>
- );
- }}
- fnGetId={(id) => {
- return id;
- }}
+ fnItemRenderer={(id: number) => (
+ <Focusable
+ onActivate={() => {}}
+ style={{
+ marginTop: '40px',
+ height: 'calc( 100% - 40px )',
+ overflowY: 'scroll',
+ display: 'flex',
+ justifyContent: 'center',
+ margin: '40px',
+ }}
+ >
+ <div>
+ <h1>{versionInfo?.all?.[id]?.name}</h1>
+ {versionInfo?.all?.[id]?.body ? (
+ <Suspense fallback={<Spinner style={{ width: '24', height: '24' }} />}>
+ <MarkdownRenderer>{versionInfo.all[id].body}</MarkdownRenderer>
+ </Suspense>
+ ) : (
+ 'no patch notes for this version'
+ )}
+ </div>
+ </Focusable>
+ )}
+ fnGetId={(id) => id}
nNumItems={versionInfo?.all?.length}
nHeight={window.innerHeight - 150}
nItemHeight={window.innerHeight - 200}
nItemMarginX={0}
initialColumn={0}
autoFocus={true}
- fnGetColumnWidth={(...args: any[]) => {
- console.log('cw', args);
- return window.innerWidth;
- }}
+ fnGetColumnWidth={() => window.innerWidth}
/>
</Focusable>
);
@@ -98,8 +90,8 @@ export default function UpdaterSettings() {
return (
<>
<Field
- onOptionsActionDescription="Patch Notes"
- onOptionsButton={showPatchNotes}
+ onOptionsActionDescription={versionInfo?.all ? 'Patch Notes' : undefined}
+ onOptionsButton={versionInfo?.all ? showPatchNotes : undefined}
label="Updates"
description={
versionInfo && (