mirror of
https://git.um-react.app/um/um-react.git
synced 2026-11-25 22:56:59 +00:00
feat: integrate platform provider with enhanced crypto handling and new AppLayout component
- Added a new `AppLayout` component to manage navigation and routing within the application. - Refactored `AppRoot` to utilize `PlatformLoadGuard` for ensuring platform readiness before rendering. - Introduced `useAppStore` hook for accessing the Redux store directly. - Updated `SDKVersion` and `PanelQingTing` components to leverage the new platform provider for crypto operations. - Enhanced error handling with `PlatformNotInitializedError` for better user feedback on uninitialized platform states. - Added tests for new functionalities and ensured compatibility with the updated platform architecture.
This commit is contained in:
1 parent
cb5531e9e4
commit
b5fdc8ebbe
18 files changed
+466
-102
No files matched your search
@@ -14,6 +14,22 @@ export class NotImplementedError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Thrown when `crypto.*` (or other init-gated APIs) is used before `provider.init()` completes.
|
||||
* Distinct from {@link NotImplementedError} (not wired) and {@link NotSupportedMethod} (unsupported).
|
||||
*/
|
||||
export class PlatformNotInitializedError extends Error {
|
||||
readonly code = 'NOT_INITIALIZED' as const;
|
||||
|
||||
constructor(
|
||||
readonly capability: string,
|
||||
message?: string,
|
||||
) {
|
||||
super(message ?? `Platform not initialized; call init() before using ${capability}`);
|
||||
this.name = 'PlatformNotInitializedError';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Thrown when the current platform explicitly does not support a method / mode
|
||||
* (e.g. Browser `keys.importNative`, or `saveMany(DirectWrite)` when not in `downloadTypes`).
|
||||
|
||||
Reference in new issue
Block a user