chore: show error msg (not err code) when installing exts via deeplink/store fails (#1007)

* chore: show error msg (not err code) when installing exts via deeplink fails

When installing extensions via deeplink fails, previous implementation
showed the raw error code returned from the backend interfaces, which
is not user-friendly. We now call installExtensionError() to interrupt
the error code to get a human-readable error message, then show it to
the users.

* fix: correct install extension error when installing via store
This commit is contained in:
SteveLauC
2025-12-14 09:24:13 +08:00
committed by GitHub
parent 67c8c4bdfa
commit 501f6df473
3 changed files with 5 additions and 2 deletions

View File

@@ -19,6 +19,8 @@ Information about release notes of Coco App is provided here.
### ✈️ Improvements
- chore: show error msg (not err code) when installing exts via deeplink fails #1007
## 0.9.1 (2025-12-05)
### ❌ Breaking changes

View File

@@ -244,7 +244,7 @@ const ExtensionStore = ({ extensionId }: { extensionId?: string }) => {
"info"
);
} catch (error) {
installExtensionError(String(error));
installExtensionError(error);
} finally {
const { installingExtensions } = useSearchStore.getState();

View File

@@ -12,6 +12,7 @@ import platformAdapter from "@/utils/platformAdapter";
import { useTranslation } from "react-i18next";
import { MAIN_WINDOW_LABEL, SETTINGS_WINDOW_LABEL } from "@/constants";
import { useAsyncEffect, useEventListener } from "ahooks";
import { installExtensionError } from "@/utils";
export interface DeepLinkHandler {
pattern: string;
@@ -78,7 +79,7 @@ export function useDeepLinkManager() {
addError(t("deepLink.extensionInstallSuccessfully"), "info");
console.log("Extension installed successfully:", extensionId);
} catch (error) {
addError(String(error));
installExtensionError(error)
}
}, []);