Skip to content

Commit

Permalink
Back-merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Jan 19, 2022
2 parents ecb6ed5 + 90e075c commit 4edc0b7
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 609 deletions.
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged --allow-empty

yarn update-mocks
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "safe-react",
"version": "3.17.0",
"version": "3.17.1",
"description": "Allowing crypto users manage funds in a safer way",
"website": "https://github.com/gnosis/safe-react#readme",
"bugs": {
Expand Down
49 changes: 0 additions & 49 deletions public/migrate-local-storage.html

This file was deleted.

14 changes: 2 additions & 12 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext, useEffect } from 'react'
import { useContext } from 'react'
import { makeStyles } from '@material-ui/core/styles'
import { SnackbarProvider } from 'notistack'
import { useDispatch, useSelector } from 'react-redux'
import { useSelector } from 'react-redux'
import styled from 'styled-components'

import AlertIcon from 'src/assets/icons/alert.svg'
Expand All @@ -26,8 +26,6 @@ import ReceiveModal from './ReceiveModal'
import { useSidebarItems } from 'src/components/AppLayout/Sidebar/useSidebarItems'
import useAddressBookSync from 'src/logic/addressBook/hooks/useAddressBookSync'
import { extractSafeAddress } from 'src/routes/routes'
import loadSafesFromStorage from 'src/logic/safe/store/actions/loadSafesFromStorage'
import loadCurrentSessionFromStorage from 'src/logic/currentSession/store/actions/loadCurrentSessionFromStorage'

const notificationStyles = {
success: {
Expand Down Expand Up @@ -62,7 +60,6 @@ const App: React.FC = ({ children }) => {
const currentCurrency = useSelector(currentCurrencySelector)
const granted = useSelector(grantedSelector)
const sidebarItems = useSidebarItems()
const dispatch = useDispatch()
useLoadSafe(addressFromUrl) // load initially
useSafeScheduledUpdates(addressFromUrl) // load every X seconds
useAddressBookSync()
Expand All @@ -75,13 +72,6 @@ const App: React.FC = ({ children }) => {
const onReceiveShow = () => onShow('Receive')
const onReceiveHide = () => onHide('Receive')

// Load the Safes from LS just once,
// they'll be reloaded on network change
useEffect(() => {
dispatch(loadSafesFromStorage())
dispatch(loadCurrentSessionFromStorage())
}, [dispatch])

return (
<Frame>
<SnackbarProvider
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppLayout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const HeaderComponent = (): React.ReactElement => {

useEffect(() => {
const tryToConnectToLastUsedProvider = async () => {
const lastUsedProvider = await loadLastUsedProvider()
const lastUsedProvider = loadLastUsedProvider()
if (lastUsedProvider) {
await onboard().walletSelect(lastUsedProvider)
}
Expand Down
7 changes: 5 additions & 2 deletions src/components/Root/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import Providers from '../Providers'
import './index.module.scss'
import './OnboardCustom.module.scss'
import './KeystoneCustom.module.scss'
import StoreMigrator from 'src/components/StoreMigrator'
import LegacyRouteRedirection from './LegacyRouteRedirection'
import { logError, Errors, CodedException } from 'src/logic/exceptions/CodedException'
import { loadChains } from 'src/config/cache/chains'
import { setChainId } from 'src/logic/config/utils'
import { _getChainId } from 'src/config'

// Preloader is rendered outside of '#root' and acts as a loading spinner
// for the app and then chains loading
Expand All @@ -40,6 +41,9 @@ const RootConsumer = (): React.ReactElement | null => {
}
}
initChains()

// Set store chainId and init contracts/session
setChainId(_getChainId())
}, [])

// Chains failed to load
Expand All @@ -62,7 +66,6 @@ const RootConsumer = (): React.ReactElement | null => {
<Loader size="md" />
</LoadingContainer>,
)}
<StoreMigrator />
</App>
)
}
Expand Down
Loading

0 comments on commit 4edc0b7

Please sign in to comment.