···
import React from "@moonlight-mod/wp/react";
import { UpdateState } from "../../types";
import HelpMessage from "./HelpMessage";
+
import { MoonlightBranch } from "@moonlight-mod/types";
+
import MarkupUtils from "@moonlight-mod/wp/discord/modules/markup/MarkupUtils";
+
import spacepack from "@moonlight-mod/wp/spacepack_spacepack";
+
import Flex from "@moonlight-mod/wp/discord/uikit/Flex";
+
const MarkupClasses = spacepack.findByCode("markup:", "inlineFormat:")[0].exports;
const logger = moonlight.getLogger("moonbase/ui/update");
···
[UpdateState.Failed]: "Failed to update moonlight. Please use the installer instead."
+
function MoonlightChangelog({
+
transitionState: number | null;
+
<ModalRoot transitionState={transitionState} size={ModalSize.DYNAMIC}>
+
{/* @ts-expect-error TODO: mappings */}
+
<Flex.Child grow={1} shrink={1}>
+
<Heading variant="heading-lg/semibold">moonlight</Heading>
+
<Text variant="text-xs/normal">{version}</Text>
+
{/* @ts-expect-error ^^^^ */}
+
<ModalCloseButton onClick={onClose} />
+
<Text variant="text-md/normal" className={MarkupClasses.markup} style={{ padding: "1rem" }}>
+
{MarkupUtils.parse(changelog, true, {
export default function Update() {
const [state, setState] = React.useState(UpdateState.Ready);
const newVersion = useStateFromStores([MoonbaseSettingsStore], () => MoonbaseSettingsStore.newVersion);
···
<HelpMessage text={strings[state]} className="moonbase-update-section" icon={ThemeDarkIcon}>
<div className="moonbase-help-message-buttons">
+
{moonlight.branch === MoonlightBranch.STABLE && (
+
look={Button.Looks.OUTLINED}
+
color={Button.Colors.CUSTOM}
+
size={Button.Sizes.TINY}
+
fetch(`https://raw.githubusercontent.com/moonlight-mod/moonlight/refs/tags/${newVersion}/CHANGELOG.md`)
+
// @ts-expect-error TODO: mappings
+
openModal((modalProps: { transitionState: number | null; onClose: () => void }) => {
+
return <MoonlightChangelog {...modalProps} changelog={changelog} version={newVersion} />;
{state === UpdateState.Installed && (
look={Button.Looks.OUTLINED}