diff --git a/packages/apps/src/Root.tsx b/packages/apps/src/Root.tsx index cedd8dc..1b35578 100644 --- a/packages/apps/src/Root.tsx +++ b/packages/apps/src/Root.tsx @@ -16,7 +16,6 @@ import BeforeApiInit from './overlays/BeforeInit.js'; import Apps from './Apps.js'; interface Props { - isElectron: boolean; store?: KeyringStore; } @@ -29,7 +28,7 @@ function createTheme (settings: { uiTheme?: string }): ThemeDef { return { theme }; } -function Root ({ isElectron, store }: Props): React.ReactElement { +function Root ({ store }: Props): React.ReactElement { const [theme, setTheme] = useState(() => createTheme(settings)); useEffect((): void => { @@ -45,7 +44,6 @@ function Root ({ isElectron, store }: Props): React.ReactElement { } - isElectron={isElectron} store={store} > diff --git a/packages/apps/src/index.tsx b/packages/apps/src/index.tsx index 97c48ec..1c99578 100644 --- a/packages/apps/src/index.tsx +++ b/packages/apps/src/index.tsx @@ -21,5 +21,5 @@ if (!rootElement) { } createRoot(rootElement).render( - + ); diff --git a/packages/page-accounts/src/Accounts/index.tsx b/packages/page-accounts/src/Accounts/index.tsx index b8cc033..b317104 100644 --- a/packages/page-accounts/src/Accounts/index.tsx +++ b/packages/page-accounts/src/Accounts/index.tsx @@ -96,7 +96,7 @@ function groupAccounts (accounts: SortedAccount[]): Record function Overview ({ className = '', onStatusChange }: Props): React.ReactElement { const { t } = useTranslation(); - const { api, fork, isElectron } = useApi(); + const { api, fork } = useApi(); const { allAccounts, hasAccounts } = useAccounts(); const { isIpfs } = useIpfs(); const { isLedgerEnabled } = useLedger(); @@ -154,8 +154,8 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen ); const canStoreAccounts = useMemo( - () => isElectron || (!isIpfs && settings.get().storage === 'on'), - [isElectron, isIpfs] + () => !isIpfs && settings.get().storage === 'on', + [isIpfs] ); // We use favorites only to check if it includes some element, diff --git a/packages/page-accounts/src/CreateAccount.slow.spec.tsx b/packages/page-accounts/src/CreateAccount.slow.spec.tsx index 3503ecc..86ff637 100644 --- a/packages/page-accounts/src/CreateAccount.slow.spec.tsx +++ b/packages/page-accounts/src/CreateAccount.slow.spec.tsx @@ -29,7 +29,6 @@ const renderAccounts = () => { diff --git a/packages/page-bounties/src/Bounties.slow.spec.tsx b/packages/page-bounties/src/Bounties.slow.spec.tsx index 3e12c66..e1ae483 100644 --- a/packages/page-bounties/src/Bounties.slow.spec.tsx +++ b/packages/page-bounties/src/Bounties.slow.spec.tsx @@ -31,7 +31,6 @@ const renderBounties = () => { diff --git a/packages/page-settings/src/General.tsx b/packages/page-settings/src/General.tsx index 59315cc..ccdcebd 100644 --- a/packages/page-settings/src/General.tsx +++ b/packages/page-settings/src/General.tsx @@ -19,12 +19,12 @@ interface Props { className?: string; } -const _ledgerConnOptions = settings.availableLedgerConn; +const ledgerConnOptions = settings.availableLedgerConn; const _ledgerAppOptions = settings.availableLedgerApp; function General ({ className = '' }: Props): React.ReactElement { const { t } = useTranslation(); - const { chainSS58, isApiReady, isElectron } = useApi(); + const { chainSS58, isApiReady } = useApi(); const { isIpfs } = useIpfs(); const { hasLedgerChain, hasWebUsb } = useLedger(); // tri-state: null = nothing changed, false = no reload, true = reload required @@ -35,11 +35,6 @@ function General ({ className = '' }: Props): React.ReactElement { return { ...values, uiTheme: values.uiTheme === 'dark' ? 'dark' : 'light' }; }); - const ledgerConnOptions = useMemo( - () => _ledgerConnOptions.filter(({ value }) => !isElectron || value !== 'webusb'), - [isElectron] - ); - const iconOptions = useMemo( () => settings.availableIcons .map((o): Option => createIdenticon(o, ['default'])) @@ -153,7 +148,7 @@ function General ({ className = '' }: Props): React.ReactElement { options={prefixOptions} /> - {!isIpfs && !isElectron && ( + {!isIpfs && ( <>
string { +function makeCreateLink (baseApiUrl: string): (path: string) => string { return (path: string, apiUrl?: string): string => - `${isElectron - ? 'https://pezkuwi.js.org/apps/' - : `${window.location.origin}${window.location.pathname}` - }?rpc=${encodeURIComponent(apiUrl || baseApiUrl)}#${path}`; + `${window.location.origin}${window.location.pathname}?rpc=${encodeURIComponent(apiUrl || baseApiUrl)}#${path}`; } async function retrieve (api: ApiPromise, injectedPromise: Promise): Promise { @@ -308,7 +304,7 @@ async function createApi (apiUrl: string, signer: ApiSigner, isLocalFork: boolea return { fork: chopsticksFork, types }; } -export function ApiCtxRoot ({ apiUrl, beforeApiInit, children, isElectron, store: keyringStore }: Props): React.ReactElement | null { +export function ApiCtxRoot ({ apiUrl, beforeApiInit, children, store: keyringStore }: Props): React.ReactElement | null { const { queuePayload, queueSetTxStatus } = useQueue(); const [state, setState] = useState(EMPTY_STATE); const [isApiConnected, setIsApiConnected] = useState(false); @@ -341,8 +337,8 @@ export function ApiCtxRoot ({ apiUrl, beforeApiInit, children, isElectron, store const apiCoretime = useApiUrl(coretimeUrls); const apiSystemPeople = useApiUrl(peopleUrls); const createLink = useMemo( - () => makeCreateLink(apiUrl, isElectron), - [apiUrl, isElectron] + () => makeCreateLink(apiUrl), + [apiUrl] ); const enableIdentity = apiEndpoint?.isPeople || // Ensure that teyrchains that don't have isPeopleForIdentity set, can access there own identity pallet. @@ -350,8 +346,8 @@ export function ApiCtxRoot ({ apiUrl, beforeApiInit, children, isElectron, store // Ensure that when isPeopleForIdentity is set to false that it enables the identity pallet access. (typeof apiEndpoint?.isPeopleForIdentity === 'boolean' && !apiEndpoint?.isPeopleForIdentity); const value = useMemo( - () => objectSpread({}, state, { api: statics.api, apiCoretime, apiEndpoint, apiError, apiIdentity: ((apiEndpoint?.isPeopleForIdentity && apiSystemPeople) || statics.api), apiRelay, apiSystemPeople, apiUrl, createLink, enableIdentity, extensions, isApiConnected, isApiInitialized, isElectron, isLocalFork, isWaitingInjected: !extensions }), - [apiError, createLink, extensions, isApiConnected, isApiInitialized, isElectron, isLocalFork, state, apiEndpoint, apiCoretime, apiRelay, apiUrl, apiSystemPeople, enableIdentity] + () => objectSpread({}, state, { api: statics.api, apiCoretime, apiEndpoint, apiError, apiIdentity: ((apiEndpoint?.isPeopleForIdentity && apiSystemPeople) || statics.api), apiRelay, apiSystemPeople, apiUrl, createLink, enableIdentity, extensions, isApiConnected, isApiInitialized, isLocalFork, isWaitingInjected: !extensions }), + [apiError, createLink, extensions, isApiConnected, isApiInitialized, isLocalFork, state, apiEndpoint, apiCoretime, apiRelay, apiUrl, apiSystemPeople, enableIdentity] ); // initial initialization diff --git a/packages/react-api/src/types.ts b/packages/react-api/src/types.ts index af6c9a9..913f307 100644 --- a/packages/react-api/src/types.ts +++ b/packages/react-api/src/types.ts @@ -87,7 +87,6 @@ export interface ApiProps extends ApiState { extensions?: InjectedExtension[]; isApiConnected: boolean; isApiInitialized: boolean; - isElectron: boolean; isWaitingInjected: boolean; isLocalFork?: boolean; } diff --git a/packages/react-hooks/src/ctx/types.ts b/packages/react-hooks/src/ctx/types.ts index 92e78ba..7c1fab4 100644 --- a/packages/react-hooks/src/ctx/types.ts +++ b/packages/react-hooks/src/ctx/types.ts @@ -66,7 +66,6 @@ export interface ApiProps extends ApiState { extensions?: InjectedExtension[]; isApiConnected: boolean; isApiInitialized: boolean; - isElectron: boolean; isWaitingInjected: boolean; isLocalFork?: boolean; }