Feat: publish to s3 & auto update (#511)
* publish to s3 * add update base url * autoupdate from s3 * fix warning * update locales * update publish workflow
This commit is contained in:
@@ -1,11 +1,23 @@
|
||||
import { t } from "i18next";
|
||||
import { Button, Separator } from "@renderer/components/ui";
|
||||
import { Button, Separator, toast } from "@renderer/components/ui";
|
||||
import { AppSettingsProviderContext } from "@renderer/context";
|
||||
import { useContext } from "react";
|
||||
|
||||
export const About = () => {
|
||||
const { version, EnjoyApp } = useContext(AppSettingsProviderContext);
|
||||
|
||||
const checkUpdate = async () => {
|
||||
toast.promise(
|
||||
EnjoyApp.app.update().catch((error) => {
|
||||
toast.error(error);
|
||||
EnjoyApp.shell.openExternal("https://1000h.org/enjoy-app/install.html");
|
||||
}),
|
||||
{
|
||||
loading: t("checkingLatestVersion"),
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="font-semibold mb-4 capitilized">{t("about")}</div>
|
||||
@@ -15,15 +27,7 @@ export const About = () => {
|
||||
<div className="mb-2">{t("currentVersion")}</div>
|
||||
<div className="text-sm text-muted-foreground mb-2">v{version}</div>
|
||||
</div>
|
||||
<Button
|
||||
onClick={() => {
|
||||
EnjoyApp.shell.openExternal(
|
||||
"https://github.com/xiaolai/everyone-can-use-english/releases/latest"
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("checkUpdate")}
|
||||
</Button>
|
||||
<Button onClick={checkUpdate}>{t("checkUpdate")}</Button>
|
||||
</div>
|
||||
|
||||
<Separator />
|
||||
|
||||
@@ -29,7 +29,7 @@ export const ThemeSettings = () => {
|
||||
}}
|
||||
>
|
||||
<SelectTrigger className="text-xs">
|
||||
<SelectValue asChild>
|
||||
<SelectValue>
|
||||
<Button variant="ghost" size="icon">
|
||||
<SunIcon className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
|
||||
<MoonIcon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
|
||||
@@ -37,6 +37,7 @@ export const ThemeSettings = () => {
|
||||
</Button>
|
||||
</SelectValue>
|
||||
</SelectTrigger>
|
||||
|
||||
<SelectContent>
|
||||
<SelectItem className="text-xs" value="light">
|
||||
{t("light")}
|
||||
|
||||
Reference in New Issue
Block a user