feat: added alpha release check to debug menu

pull/3281/head
yougotwill 3 months ago
parent 8bd89de35a
commit b5c96345b5

@ -17,6 +17,7 @@ import { updateDebugMenuModal } from '../../../state/ducks/modalDialog';
export const DebugActions = () => { export const DebugActions = () => {
const [loadingLatestRelease, setLoadingLatestRelease] = useBoolean(false); const [loadingLatestRelease, setLoadingLatestRelease] = useBoolean(false);
const [loadingAlphaRelease, setLoadingAlphaRelease] = useBoolean(false);
const dispatch = useDispatch(); const dispatch = useDispatch();
@ -77,7 +78,7 @@ export const DebugActions = () => {
const userEd25519SecretKey = (await UserUtils.getUserED25519KeyPairBytes()) const userEd25519SecretKey = (await UserUtils.getUserED25519KeyPairBytes())
?.privKeyBytes; ?.privKeyBytes;
if (!userEd25519SecretKey) { if (!userEd25519SecretKey) {
window.log.error('[debugMenu] no userEd25519SecretKey'); window.log.error('[debugMenu] debugLatestRelease no userEd25519SecretKey');
return; return;
} }
setLoadingLatestRelease(true); setLoadingLatestRelease(true);
@ -94,6 +95,31 @@ export const DebugActions = () => {
<SessionSpinner loading={loadingLatestRelease} color={'var(--text-primary-color)'} /> <SessionSpinner loading={loadingLatestRelease} color={'var(--text-primary-color)'} />
{!loadingLatestRelease ? 'Check latest release' : null} {!loadingLatestRelease ? 'Check latest release' : null}
</SessionButton> </SessionButton>
<SessionButton
onClick={async () => {
const userEd25519SecretKey = (await UserUtils.getUserED25519KeyPairBytes())
?.privKeyBytes;
if (!userEd25519SecretKey) {
window.log.error('[debugMenu] debugAlphaRelease no userEd25519SecretKey');
return;
}
setLoadingAlphaRelease(true);
const versionNumber = await getLatestReleaseFromFileServer(
userEd25519SecretKey,
'alpha'
);
setLoadingAlphaRelease(false);
if (versionNumber) {
ToastUtils.pushToastInfo('debugAlphaRelease', `v${versionNumber}`);
} else {
ToastUtils.pushToastError('debugAlphaRelease', 'Failed to fetch latest release');
}
}}
>
<SessionSpinner loading={loadingAlphaRelease} color={'var(--text-primary-color)'} />
{!loadingAlphaRelease ? 'Check alpha release' : null}
</SessionButton>
</Flex> </Flex>
</> </>
); );

Loading…
Cancel
Save