Files
mutiny-web/src/components/Restart.tsx
Paul Miller e01b8465d5 web worker
check if already initialized

more progress, zap feed not loading?

request send receive

fix setup

profile editing and show zaps

wallet connections

kitchen sink

mutiny plus and misc

get rid of swap

backup / restore, nostr stuff

get rid of gifts

channels stuff

manage federations and profile fixes

cleanup

fix build

fix chrome android

update to cap 6

bump to actual 6.0.0

update xcode version

fix interpolation again (regression)

move all static methods to the worker

add doc strings

get rid of window.nostr, make parse params async

fight load flicker

use a "-test" bundle for debug builds so they don't clobber

add back swaps and do some cleanup

fix activity flicker
2024-05-06 21:00:59 +01:00

42 lines
1.1 KiB
TypeScript

import { createSignal } from "solid-js";
import { Button, InnerCard, NiceP, VStack } from "~/components";
import { useI18n } from "~/i18n/context";
import { useMegaStore } from "~/state/megaStore";
export function Restart() {
const i18n = useI18n();
const [_state, _actions, sw] = useMegaStore();
const [hasStopped, setHasStopped] = createSignal(false);
async function toggle() {
try {
if (hasStopped()) {
await sw.start();
setHasStopped(false);
} else {
await sw.stop();
setHasStopped(true);
}
} catch (e) {
console.error(e);
}
}
return (
<InnerCard>
<VStack>
<NiceP>{i18n.t("error.restart.title")}</NiceP>
<Button
intent={hasStopped() ? "green" : "red"}
onClick={toggle}
>
{hasStopped()
? i18n.t("error.restart.start")
: i18n.t("error.restart.stop")}
</Button>
</VStack>
</InnerCard>
);
}