mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove unused transForward
state and actions (#8401)
The `transForward` app state is no longer used, so it has been removed. Associated actions have been removed as well. This state dates back a few years, so I was unable to determine when it was made obsolete.
This commit is contained in:
parent
24a8689090
commit
3620146e63
@ -175,7 +175,6 @@
|
|||||||
"modalState": {},
|
"modalState": {},
|
||||||
"previousModalState": {}
|
"previousModalState": {}
|
||||||
},
|
},
|
||||||
"transForward": true,
|
|
||||||
"isLoading": false,
|
"isLoading": false,
|
||||||
"warning": null,
|
"warning": null,
|
||||||
"scrollToBottom": false,
|
"scrollToBottom": false,
|
||||||
|
@ -135,7 +135,6 @@
|
|||||||
"modalState": {},
|
"modalState": {},
|
||||||
"previousModalState": {}
|
"previousModalState": {}
|
||||||
},
|
},
|
||||||
"transForward": true,
|
|
||||||
"isLoading": false,
|
"isLoading": false,
|
||||||
"warning": null,
|
"warning": null,
|
||||||
"scrollToBottom": false,
|
"scrollToBottom": false,
|
||||||
|
@ -1078,7 +1078,6 @@
|
|||||||
"previousModalState": {}
|
"previousModalState": {}
|
||||||
},
|
},
|
||||||
"sidebar": {},
|
"sidebar": {},
|
||||||
"transForward": true,
|
|
||||||
"isLoading": false,
|
"isLoading": false,
|
||||||
"warning": null,
|
"warning": null,
|
||||||
"scrollToBottom": false,
|
"scrollToBottom": false,
|
||||||
|
@ -779,7 +779,7 @@ describe('Actions', function () {
|
|||||||
const store = mockStore()
|
const store = mockStore()
|
||||||
const expectedActions = [
|
const expectedActions = [
|
||||||
{ type: 'DISPLAY_WARNING', value: 'error' },
|
{ type: 'DISPLAY_WARNING', value: 'error' },
|
||||||
{ type: 'SHOW_CONF_TX_PAGE', transForward: true, id: undefined },
|
{ type: 'SHOW_CONF_TX_PAGE', id: undefined },
|
||||||
]
|
]
|
||||||
sendTransactionSpy.callsFake((_, callback) => {
|
sendTransactionSpy.callsFake((_, callback) => {
|
||||||
callback(new Error('error'))
|
callback(new Error('error'))
|
||||||
|
@ -127,20 +127,11 @@ describe('App State', function () {
|
|||||||
assert.equal(newState.modal.modalState.name, null)
|
assert.equal(newState.modal.modalState.name, null)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('transitions forwards', function () {
|
|
||||||
const state = reduceApp(metamaskState, {
|
|
||||||
type: actions.TRANSITION_FORWARD,
|
|
||||||
})
|
|
||||||
|
|
||||||
assert.equal(state.transForward, true)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('shows send token page', function () {
|
it('shows send token page', function () {
|
||||||
const state = reduceApp(metamaskState, {
|
const state = reduceApp(metamaskState, {
|
||||||
type: actions.SHOW_SEND_TOKEN_PAGE,
|
type: actions.SHOW_SEND_TOKEN_PAGE,
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.equal(state.transForward, true)
|
|
||||||
assert.equal(state.warning, null)
|
assert.equal(state.warning, null)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -149,7 +140,6 @@ describe('App State', function () {
|
|||||||
type: actions.LOCK_METAMASK,
|
type: actions.LOCK_METAMASK,
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.equal(state.transForward, false)
|
|
||||||
assert.equal(state.warning, null)
|
assert.equal(state.warning, null)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -161,7 +151,6 @@ describe('App State', function () {
|
|||||||
assert.equal(state.accountDetail.subview, 'transactions')
|
assert.equal(state.accountDetail.subview, 'transactions')
|
||||||
assert.equal(state.accountDetail.accountExport, 'none')
|
assert.equal(state.accountDetail.accountExport, 'none')
|
||||||
assert.equal(state.accountDetail.privateKey, '')
|
assert.equal(state.accountDetail.privateKey, '')
|
||||||
assert.equal(state.transForward, false)
|
|
||||||
assert.equal(state.warning, null)
|
assert.equal(state.warning, null)
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -175,7 +164,6 @@ describe('App State', function () {
|
|||||||
assert.equal(state.accountDetail.subview, 'transactions') // default
|
assert.equal(state.accountDetail.subview, 'transactions') // default
|
||||||
assert.equal(state.accountDetail.accountExport, 'none') // default
|
assert.equal(state.accountDetail.accountExport, 'none') // default
|
||||||
assert.equal(state.accountDetail.privateKey, '') // default
|
assert.equal(state.accountDetail.privateKey, '') // default
|
||||||
assert.equal(state.transForward, false)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -184,7 +172,6 @@ describe('App State', function () {
|
|||||||
type: actions.SHOW_ACCOUNTS_PAGE,
|
type: actions.SHOW_ACCOUNTS_PAGE,
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.equal(state.transForward, true)
|
|
||||||
assert.equal(state.isLoading, false)
|
assert.equal(state.isLoading, false)
|
||||||
assert.equal(state.warning, null)
|
assert.equal(state.warning, null)
|
||||||
assert.equal(state.scrollToBottom, false)
|
assert.equal(state.scrollToBottom, false)
|
||||||
@ -206,11 +193,9 @@ describe('App State', function () {
|
|||||||
const state = reduceApp(oldState, {
|
const state = reduceApp(oldState, {
|
||||||
type: actions.SHOW_CONF_TX_PAGE,
|
type: actions.SHOW_CONF_TX_PAGE,
|
||||||
id: 2,
|
id: 2,
|
||||||
transForward: false,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.equal(state.txId, 2)
|
assert.equal(state.txId, 2)
|
||||||
assert.equal(state.transForward, false)
|
|
||||||
assert.equal(state.warning, null)
|
assert.equal(state.warning, null)
|
||||||
assert.equal(state.isLoading, false)
|
assert.equal(state.isLoading, false)
|
||||||
|
|
||||||
@ -238,7 +223,6 @@ describe('App State', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
assert.equal(state.txId, null)
|
assert.equal(state.txId, null)
|
||||||
assert.equal(state.transForward, false)
|
|
||||||
assert.equal(state.warning, null)
|
assert.equal(state.warning, null)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -250,7 +234,6 @@ describe('App State', function () {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.equal(state.transForward, false)
|
|
||||||
assert.equal(state.warning, null)
|
assert.equal(state.warning, null)
|
||||||
assert.equal(state.accountDetail.subview, 'transactions')
|
assert.equal(state.accountDetail.subview, 'transactions')
|
||||||
})
|
})
|
||||||
|
@ -31,8 +31,6 @@ export default function reduceApp (state = {}, action) {
|
|||||||
accountDetail: {
|
accountDetail: {
|
||||||
subview: 'transactions',
|
subview: 'transactions',
|
||||||
},
|
},
|
||||||
// Used to render transition direction
|
|
||||||
transForward: true,
|
|
||||||
// Used to display loading indicator
|
// Used to display loading indicator
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
// Used to display error text
|
// Used to display error text
|
||||||
@ -138,13 +136,6 @@ export default function reduceApp (state = {}, action) {
|
|||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
// transition methods
|
|
||||||
case actionConstants.TRANSITION_FORWARD:
|
|
||||||
return {
|
|
||||||
...appState,
|
|
||||||
transForward: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
case actionConstants.FORGOT_PASSWORD:
|
case actionConstants.FORGOT_PASSWORD:
|
||||||
return {
|
return {
|
||||||
...appState,
|
...appState,
|
||||||
@ -154,14 +145,12 @@ export default function reduceApp (state = {}, action) {
|
|||||||
case actionConstants.SHOW_SEND_TOKEN_PAGE:
|
case actionConstants.SHOW_SEND_TOKEN_PAGE:
|
||||||
return {
|
return {
|
||||||
...appState,
|
...appState,
|
||||||
transForward: true,
|
|
||||||
warning: null,
|
warning: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
case actionConstants.LOCK_METAMASK:
|
case actionConstants.LOCK_METAMASK:
|
||||||
return {
|
return {
|
||||||
...appState,
|
...appState,
|
||||||
transForward: false,
|
|
||||||
warning: null,
|
warning: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +164,6 @@ export default function reduceApp (state = {}, action) {
|
|||||||
accountExport: 'none',
|
accountExport: 'none',
|
||||||
privateKey: '',
|
privateKey: '',
|
||||||
},
|
},
|
||||||
transForward: false,
|
|
||||||
warning: null,
|
warning: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,13 +176,11 @@ export default function reduceApp (state = {}, action) {
|
|||||||
accountExport: 'none',
|
accountExport: 'none',
|
||||||
privateKey: '',
|
privateKey: '',
|
||||||
},
|
},
|
||||||
transForward: false,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case actionConstants.SHOW_ACCOUNTS_PAGE:
|
case actionConstants.SHOW_ACCOUNTS_PAGE:
|
||||||
return {
|
return {
|
||||||
...appState,
|
...appState,
|
||||||
transForward: true,
|
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
warning: null,
|
warning: null,
|
||||||
scrollToBottom: false,
|
scrollToBottom: false,
|
||||||
@ -205,7 +191,6 @@ export default function reduceApp (state = {}, action) {
|
|||||||
return {
|
return {
|
||||||
...appState,
|
...appState,
|
||||||
txId: action.id,
|
txId: action.id,
|
||||||
transForward: action.transForward,
|
|
||||||
warning: null,
|
warning: null,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
}
|
}
|
||||||
@ -214,7 +199,6 @@ export default function reduceApp (state = {}, action) {
|
|||||||
if (action.value.unconfirmedActionsCount > 0) {
|
if (action.value.unconfirmedActionsCount > 0) {
|
||||||
return {
|
return {
|
||||||
...appState,
|
...appState,
|
||||||
transForward: false,
|
|
||||||
txId: null,
|
txId: null,
|
||||||
warning: null,
|
warning: null,
|
||||||
}
|
}
|
||||||
@ -223,7 +207,6 @@ export default function reduceApp (state = {}, action) {
|
|||||||
...appState,
|
...appState,
|
||||||
// indicate notification should close
|
// indicate notification should close
|
||||||
shouldClose: true,
|
shouldClose: true,
|
||||||
transForward: false,
|
|
||||||
warning: null,
|
warning: null,
|
||||||
txId: null,
|
txId: null,
|
||||||
accountDetail: {
|
accountDetail: {
|
||||||
|
@ -223,7 +223,6 @@ export default {
|
|||||||
'modalState': {},
|
'modalState': {},
|
||||||
'previousModalState': {},
|
'previousModalState': {},
|
||||||
},
|
},
|
||||||
'transForward': true,
|
|
||||||
'isLoading': false,
|
'isLoading': false,
|
||||||
'warning': null,
|
'warning': null,
|
||||||
'scrollToBottom': false,
|
'scrollToBottom': false,
|
||||||
|
@ -224,7 +224,6 @@ export default {
|
|||||||
'modalState': {},
|
'modalState': {},
|
||||||
'previousModalState': {},
|
'previousModalState': {},
|
||||||
},
|
},
|
||||||
'transForward': true,
|
|
||||||
'isLoading': false,
|
'isLoading': false,
|
||||||
'warning': null,
|
'warning': null,
|
||||||
'scrollToBottom': false,
|
'scrollToBottom': false,
|
||||||
|
@ -16,8 +16,6 @@ export default {
|
|||||||
// network dropdown open
|
// network dropdown open
|
||||||
NETWORK_DROPDOWN_OPEN: 'UI_NETWORK_DROPDOWN_OPEN',
|
NETWORK_DROPDOWN_OPEN: 'UI_NETWORK_DROPDOWN_OPEN',
|
||||||
NETWORK_DROPDOWN_CLOSE: 'UI_NETWORK_DROPDOWN_CLOSE',
|
NETWORK_DROPDOWN_CLOSE: 'UI_NETWORK_DROPDOWN_CLOSE',
|
||||||
// transition state
|
|
||||||
TRANSITION_FORWARD: 'TRANSITION_FORWARD',
|
|
||||||
// remote state
|
// remote state
|
||||||
UPDATE_METAMASK_STATE: 'UPDATE_METAMASK_STATE',
|
UPDATE_METAMASK_STATE: 'UPDATE_METAMASK_STATE',
|
||||||
FORGOT_PASSWORD: 'FORGOT_PASSWORD',
|
FORGOT_PASSWORD: 'FORGOT_PASSWORD',
|
||||||
|
@ -63,7 +63,6 @@ export function tryUnlockMetamask (password) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
dispatch(transitionForward())
|
|
||||||
dispatch(hideLoadingIndication())
|
dispatch(hideLoadingIndication())
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@ -74,12 +73,6 @@ export function tryUnlockMetamask (password) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function transitionForward () {
|
|
||||||
return {
|
|
||||||
type: actionConstants.TRANSITION_FORWARD,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createNewVaultAndRestore (password, seed) {
|
export function createNewVaultAndRestore (password, seed) {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(showLoadingIndication())
|
dispatch(showLoadingIndication())
|
||||||
@ -1259,10 +1252,9 @@ export function showAccountsPage () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function showConfTxPage ({ transForward = true, id } = {}) {
|
export function showConfTxPage ({ id } = {}) {
|
||||||
return {
|
return {
|
||||||
type: actionConstants.SHOW_CONF_TX_PAGE,
|
type: actionConstants.SHOW_CONF_TX_PAGE,
|
||||||
transForward,
|
|
||||||
id,
|
id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user