Use hash history (#638)

* v1.7.3 (#611)

* Fix #597: USD value not load (#609)

* Converts all the addresses to checksum values

* Fix for empty address

* fix the order of transactions, change updateSafe to upgradeSafe to avoid naming confusion with the updateSafe action (#610)

* Fix #596: Notification when safe is already updated (#599)

* Fix notification of update if the safe is already updated

* Makes the notification clickable
Displays the notification for owners only

* Identify upgrade tx

* Add red badge to Settings tab

* Fixs Padding
Removes the red dot if the user is not an owner

Co-authored-by: Fernando <fernando.greco@gmail.com>

Co-authored-by: Fernando <fernando.greco@gmail.com>
Co-authored-by: Agustin Pane <agustin.pane@gmail.com>

* Update package.json (#612)

* Add public url to prod webpack config (#615)

* add public url to prod webpack config

* modify travis/webpack config to add public url

* add slash

* cherry pick new travis yml merge commit (#620)

* use hash history

Co-authored-by: Fernando <fernando.greco@gmail.com>
Co-authored-by: Agustin Pane <agustin.pane@gmail.com>
This commit is contained in:
Mikhail Mikheev 2020-03-06 15:59:13 +01:00 committed by GitHub
parent 0a987c29bf
commit aaa480c2a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 16 deletions

View File

@ -13,6 +13,7 @@ type DecodedTxData = {
customTx?: boolean,
creationTx?: boolean,
data: string,
upgradeTx: boolean,
}
const getSafeVersion = (data: string) => {

View File

@ -14,7 +14,7 @@ export type SafeProps = {
blacklistedTokens: Set<string>,
ethBalance?: string,
nonce: number,
latestIncomingTxBlock: number,
latestIncomingTxBlock?: number,
recurringUser?: boolean,
}

View File

@ -16,6 +16,7 @@ export type TransactionStatus =
| 'cancelled'
| 'awaiting_execution'
| 'pending'
| 'third-party-app'
export type TransactionProps = {
nonce: ?number,

View File

@ -1,7 +1,7 @@
// @flow
import { List, Map, Set } from 'immutable'
import { type Match, matchPath } from 'react-router-dom'
import { type Selector, createSelector, createStructuredSelector } from 'reselect'
import { type OutputSelector, createSelector, createStructuredSelector } from 'reselect'
import { getWeb3 } from '~/logic/wallets/getWeb3'
import { SAFELIST_ADDRESS, SAFE_PARAM_ADDRESS } from '~/routes/routes'
@ -37,17 +37,17 @@ const safesStateSelector = (state: GlobalState): Map<string, *> => state[SAFE_RE
export const safesMapSelector = (state: GlobalState): Map<string, Safe> => state[SAFE_REDUCER_ID].get('safes')
export const safesListSelector: Selector<GlobalState, {}, List<Safe>> = createSelector(
export const safesListSelector: OutputSelector<GlobalState, {}, List<Safe>> = createSelector(
safesMapSelector,
(safes: Map<string, Safe>): List<Safe> => safes.toList(),
)
export const safesCountSelector: Selector<GlobalState, {}, number> = createSelector(
export const safesCountSelector: OutputSelector<GlobalState, {}, number> = createSelector(
safesMapSelector,
(safes: Map<string, Safe>): number => safes.size,
)
export const defaultSafeSelector: Selector<GlobalState, {}, string> = createSelector(
export const defaultSafeSelector: OutputSelector<GlobalState, {}, string> = createSelector(
safesStateSelector,
(safeState: Map<string, *>): string => safeState.get('defaultSafe'),
)
@ -67,7 +67,7 @@ export const safeParamAddressSelector = (state: GlobalState, props: RouterProps)
return urlAdd ? getWeb3().utils.toChecksumAddress(urlAdd) : ''
}
type TxSelectorType = Selector<GlobalState, RouterProps, List<Transaction>>
type TxSelectorType = OutputSelector<GlobalState, RouterProps, List<Transaction>>
export const safeTransactionsSelector: TxSelectorType = createSelector(
transactionsSelector,
@ -117,7 +117,7 @@ export const safeParamAddressFromStateSelector = (state: GlobalState): string =>
return match ? match.params.safeAddress : null
}
type IncomingTxSelectorType = Selector<GlobalState, RouterProps, List<IncomingTransaction>>
type IncomingTxSelectorType = OutputSelector<GlobalState, RouterProps, List<IncomingTransaction>>
export const safeIncomingTransactionsSelector: IncomingTxSelectorType = createSelector(
incomingTransactionsSelector,
@ -135,7 +135,7 @@ export const safeIncomingTransactionsSelector: IncomingTxSelectorType = createSe
},
)
export const confirmationsTransactionSelector: Selector<GlobalState, TransactionProps, number> = createSelector(
export const confirmationsTransactionSelector: OutputSelector<GlobalState, TransactionProps, number> = createSelector(
oneTransactionSelector,
(tx: Transaction) => {
if (!tx) {
@ -153,7 +153,7 @@ export const confirmationsTransactionSelector: Selector<GlobalState, Transaction
export type SafeSelectorProps = Safe | typeof undefined
export const safeSelector: Selector<GlobalState, RouterProps, SafeSelectorProps> = createSelector(
export const safeSelector: OutputSelector<GlobalState, RouterProps, SafeSelectorProps> = createSelector(
safesMapSelector,
safeParamAddressFromStateSelector,
(safes: Map<string, Safe>, address: string) => {
@ -167,7 +167,7 @@ export const safeSelector: Selector<GlobalState, RouterProps, SafeSelectorProps>
},
)
export const safeActiveTokensSelector: Selector<GlobalState, RouterProps, List<string>> = createSelector(
export const safeActiveTokensSelector: OutputSelector<GlobalState, RouterProps, List<string>> = createSelector(
safeSelector,
(safe: Safe) => {
if (!safe) {
@ -178,7 +178,7 @@ export const safeActiveTokensSelector: Selector<GlobalState, RouterProps, List<s
},
)
export const safeBlacklistedTokensSelector: Selector<GlobalState, RouterProps, List<string>> = createSelector(
export const safeBlacklistedTokensSelector: OutputSelector<GlobalState, RouterProps, List<string>> = createSelector(
safeSelector,
(safe: Safe) => {
if (!safe) {
@ -195,7 +195,7 @@ export const safeActiveTokensSelectorBySafe = (safeAddress: string, safes: Map<s
export const safeBlacklistedTokensSelectorBySafe = (safeAddress: string, safes: Map<string, Safe>): List<string> =>
safes.get(safeAddress).get('blacklistedTokens')
export const safeBalancesSelector: Selector<GlobalState, RouterProps, Map<string, string>> = createSelector(
export const safeBalancesSelector: OutputSelector<GlobalState, RouterProps, Map<string, string>> = createSelector(
safeSelector,
(safe: Safe) => {
if (!safe) {
@ -206,7 +206,7 @@ export const safeBalancesSelector: Selector<GlobalState, RouterProps, Map<string
},
)
export const getActiveTokensAddressesForAllSafes: Selector<GlobalState, any, Set<string>> = createSelector(
export const getActiveTokensAddressesForAllSafes: OutputSelector<GlobalState, any, Set<string>> = createSelector(
safesListSelector,
(safes: List<Safe>) => {
const addresses = Set().withMutations(set => {
@ -221,7 +221,7 @@ export const getActiveTokensAddressesForAllSafes: Selector<GlobalState, any, Set
},
)
export const getBlacklistedTokensAddressesForAllSafes: Selector<GlobalState, any, Set<string>> = createSelector(
export const getBlacklistedTokensAddressesForAllSafes: OutputSelector<GlobalState, any, Set<string>> = createSelector(
safesListSelector,
(safes: List<Safe>) => {
const addresses = Set().withMutations(set => {

View File

@ -1,6 +1,6 @@
// @flow
import { connectRouter, routerMiddleware } from 'connected-react-router'
import { createBrowserHistory } from 'history'
import { createHashHistory } from 'history'
import { type CombinedReducer, type Store, applyMiddleware, combineReducers, compose, createStore } from 'redux'
import thunk from 'redux-thunk'
@ -35,7 +35,7 @@ import transactions, {
type State as TransactionsState,
} from '~/routes/safe/store/reducer/transactions'
export const history = createBrowserHistory({ basename: '/app/' })
export const history = createHashHistory({ hashType: 'slash' })
// eslint-disable-next-line
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose