fix: web component server list error (#781)

* chore: update app

* fix: web component server list error

* feat: add

* chore: remove defalut version
This commit is contained in:
BiggerRain
2025-07-19 17:07:11 +08:00
committed by GitHub
parent 060c09e11c
commit 3f4abe51e5
7 changed files with 56 additions and 16 deletions

View File

@@ -80,6 +80,8 @@ export function ServerList({ clearChat }: ServerListProps) {
);
useEffect(() => {
if (!isTauri) return;
fetchServers(true);
}, [currentService?.enabled]);

View File

@@ -116,7 +116,7 @@ export default function Footer({ setIsPinnedWeb }: FooterProps) {
) : (
sourceData?.source?.name ||
t("search.footer.version", {
version: process.env.VERSION || "v1.0.0",
version: process.env.VERSION || "N/A",
})
)}
</div>

View File

@@ -83,7 +83,7 @@ const Footer = () => {
<div className="flex items-center space-x-4">
<span className="text-xs text-gray-500 dark:text-gray-400">
Version {process.env.VERSION || "v1.0.0"}
Version {process.env.VERSION || "N/A"}
</span>
{/* <div className="h-4 w-px bg-gray-200 dark:bg-gray-700" />
<button className="text-xs text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors">

View File

@@ -44,7 +44,7 @@ export default function AboutView() {
</div>
<div className="mt-8 text-sm text-gray-500 dark:text-gray-400">
{t("settings.about.version", {
version: process.env.VERSION || "v1.0.0",
version: process.env.VERSION || "N/A",
})}
</div>
<div className="mt-4 text-sm text-gray-500 dark:text-gray-400">

View File

@@ -29,7 +29,15 @@ interface UpdateAppProps {
const UpdateApp = ({ isCheckPage }: UpdateAppProps) => {
const { t } = useTranslation();
const isDark = useThemeStore((state) => state.isDark);
const { visible, setVisible, skipVersion, setSkipVersion, isOptional, updateInfo, setUpdateInfo } = useUpdateStore();
const {
visible,
setVisible,
skipVersion,
setSkipVersion,
isOptional,
updateInfo,
setUpdateInfo,
} = useUpdateStore();
const addError = useAppStore((state) => state.addError);
const snapshotUpdate = useAppearanceStore((state) => state.snapshotUpdate);
@@ -125,16 +133,37 @@ const UpdateApp = ({ isCheckPage }: UpdateAppProps) => {
className="relative z-10 focus:outline-none"
onClose={noop}
>
<div className={`fixed inset-0 z-10 w-screen overflow-y-auto ${isCheckPage ? "rounded-lg bg-white dark:bg-[#333] border border-[#EDEDED] dark:border-black/20 shadow-md" : ""}`}>
<div className={clsx("flex min-h-full items-center justify-center", !isCheckPage && "p-4")}>
<div
className={`fixed inset-0 z-10 w-screen overflow-y-auto ${
isCheckPage
? "rounded-lg bg-white dark:bg-[#333] border border-[#EDEDED] dark:border-black/20 shadow-md"
: ""
}`}
>
<div
className={clsx(
"flex min-h-full items-center justify-center",
!isCheckPage && "p-4"
)}
>
<DialogPanel
transition
className={`relative w-[340px] py-8 flex flex-col items-center ${isCheckPage ? "" : "rounded-lg bg-white dark:bg-[#333] border border-[#EDEDED] dark:border-black/20 shadow-md"}`}
className={`relative w-[340px] py-8 flex flex-col items-center ${
isCheckPage
? ""
: "rounded-lg bg-white dark:bg-[#333] border border-[#EDEDED] dark:border-black/20 shadow-md"
}`}
>
{!isCheckPage && isOptional && (
<X
className={clsx("absolute size-5 top-3 right-3 text-[#999] dark:text-[#D8D8D8]", cursorClassName)}
className={clsx(
"absolute size-5 top-3 right-3 text-[#999] dark:text-[#D8D8D8]",
cursorClassName
)}
onClick={handleCancel}
role="button"
aria-label="Close dialog"
tabIndex={0}
/>
)}
@@ -142,27 +171,35 @@ const UpdateApp = ({ isCheckPage }: UpdateAppProps) => {
<div className="text-[#333] text-sm leading-5 py-2 dark:text-[#D8D8D8] text-center">
{updateInfo?.available ? (
isOptional ? t("update.optional_description") : (
isOptional ? (
t("update.optional_description")
) : (
<>
<p>{t("update.force_description1")}</p>
<p>{t("update.force_description2")}</p>
</>
)
) : t("update.date")}
) : (
t("update.date")
)}
</div>
{updateInfo?.available ? (
<div
className="text-xs text-[#0072FF] cursor-pointer"
onClick={() =>
OpenURLWithBrowser("https://docs.infinilabs.com/coco-app/main/docs/release-notes")
OpenURLWithBrowser(
"https://docs.infinilabs.com/coco-app/main/docs/release-notes"
)
}
>
v{updateInfo.version} {t("update.releaseNotes")}
</div>
) : (
<div className={clsx("text-xs text-[#999]", cursorClassName)}>
{t("update.latest", { replace: [updateInfo?.version || "v0.6.0"] })}
{t("update.latest", {
replace: [updateInfo?.version || process.env.VERSION || "N/A"],
})}
</div>
)}
@@ -179,7 +216,11 @@ const UpdateApp = ({ isCheckPage }: UpdateAppProps) => {
<LoaderCircle className="animate-spin size-5" />
{percent}%
</div>
) : updateInfo?.available ? t("update.button.install") : t("update.button.ok")}
) : updateInfo?.available ? (
t("update.button.install")
) : (
t("update.button.ok")
)}
</Button>
{updateInfo?.available && isOptional && (
@@ -194,7 +235,6 @@ const UpdateApp = ({ isCheckPage }: UpdateAppProps) => {
</div>
</div>
</Dialog>
);
};

View File

@@ -34,7 +34,6 @@ export const useUpdateStore = create<IUpdateStore>()(
name: "update-store",
partialize: (state) => ({
skipVersion: state.skipVersion,
updateInfo: state.updateInfo,
}),
}
)

View File

@@ -111,7 +111,6 @@ export const createWebAdapter = (): WebPlatformAdapter => {
},
async checkUpdate() {
console.log("Web mode simulated check update");
return null;
},