Skip to content

Commit

Permalink
feat: check for new package versions
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Aug 22, 2022
1 parent be037ad commit 573f639
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/widget-embedded/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"author": "Eugene Chybisov <eugene@li.finance>",
"dependencies": {
"@lifi/sdk": "^1.1.6",
"@lifi/sdk": "^1.2.1",
"@lifi/wallet-management": "^1.1.7",
"@lifi/widget": "^1.13.7",
"@mui/icons-material": "^5.8.4",
Expand Down Expand Up @@ -56,4 +56,4 @@
"devDependencies": {
"@types/node": "^18.7.9"
}
}
}
2 changes: 1 addition & 1 deletion packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@emotion/styled": "^11.10.0",
"@ethersproject/experimental": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@lifi/sdk": "^1.1.6",
"@lifi/sdk": "^1.2.1",
"@lifi/wallet-management": "^1.1.7",
"@mui/icons-material": "^5.8.4",
"@mui/lab": "^5.0.0-alpha.95",
Expand Down
4 changes: 3 additions & 1 deletion packages/widget/src/config/lifi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { ConfigUpdate } from '@lifi/sdk';
import LIFI from '@lifi/sdk';

export const LiFi = new LIFI();
export const LiFi = new LIFI({
disableVersionCheck: true,
});

export const updateLiFiConfig = (configUpdate: ConfigUpdate) => {
LiFi.setConfig(configUpdate);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { ChainKey } from '@lifi/sdk';
import { getChainByKey } from '@lifi/sdk';
import { checkPackageUpdates, getChainByKey } from '@lifi/sdk';
import { createContext, useContext, useEffect, useMemo } from 'react';
import { updateLiFiConfig } from '../../config/lifi';
import { name, version } from '../../config/version';
import type { WidgetContextProps, WidgetProviderProps } from './types';

const stub = (): never => {
Expand Down Expand Up @@ -88,6 +89,10 @@ export const WidgetProvider: React.FC<
});
}, [integrator]);

useEffect(() => {
checkPackageUpdates(name, version);
}, []);

return (
<WidgetContext.Provider value={value}>{children}</WidgetContext.Provider>
);
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2663,10 +2663,10 @@
npmlog "^6.0.2"
write-file-atomic "^4.0.1"

"@lifi/sdk@^1.1.6":
version "1.1.6"
resolved "https://registry.yarnpkg.com/@lifi/sdk/-/sdk-1.1.6.tgz#0d8dc839f114e1655b856753ac61afd51e89666a"
integrity sha512-5qg4dJv3/AcwmKrQwaxJN8ztoBfjtkIgrpe6m/vUUbrUrHkBrwFAuG61WXP6EyS8eThXnEzakusnpsLp5Ej2ZA==
"@lifi/sdk@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@lifi/sdk/-/sdk-1.2.1.tgz#8e2b93e8b284e7d2795782f55b939353abc0b950"
integrity sha512-DHiY/OyImmEiXmvFxAXk3qeSQic8LskGX5rwvQc6hEEwbvxuyJExWJNQJmi5prKs52He5qnFpRlY0qPuruEZrA==
dependencies:
"@ethersproject/abi" "^5.6.4"
"@ethersproject/contracts" "^5.6.2"
Expand Down

0 comments on commit 573f639

Please sign in to comment.