Skip to content
Permalink
Browse files

Upgrade Org: fix upgrade transaction for orgs with non-known apps (#977)

  • Loading branch information...
sohkai committed Sep 8, 2019
1 parent 23ab7f0 commit c3a17aaf1b60a9a95c8540608081e458ed0c88b4
Showing with 14 additions and 12 deletions.
  1. +14 −12 src/components/Upgrade/UpgradeOrganizationPanel.js
@@ -33,22 +33,24 @@ const REGISTRY = ['aragonpm.eth', 'https://etherscan.io/address/aragonpm.eth']
const UpgradeOrganizationPanel = React.memo(
({ repos = [], opened, onClose, daoAddress, wrapper }) => {
const theme = useTheme()
const knownUpgradableRepos = useMemo(
() => repos.filter(repo => isKnownRepo(repo.appId)),
[repos]
)
const [currentVersions, newVersions] = useMemo(
() =>
repos
.filter(repo => isKnownRepo(repo.appId))
.reduce(
(results, repo) => [
[...results[0], repo.currentVersion],
[...results[1], repo.latestVersion],
],
[[], []]
),
[repos]
knownUpgradableRepos.reduce(
(results, repo) => [
[...results[0], repo.currentVersion],
[...results[1], repo.latestVersion],
],
[[], []]
),
[knownUpgradableRepos]
)

const handleUpgradeAll = useCallback(async () => {
const upgradeIntents = repos.map(({ appId, versions }) => {
const upgradeIntents = knownUpgradableRepos.map(({ appId, versions }) => {
const newContractAddress = versions[versions.length - 1].contractAddress
return [
daoAddress.address,
@@ -80,7 +82,7 @@ const UpgradeOrganizationPanel = React.memo(
// The user just can't perform this action, show the signing panel's error screen
await wrapper.performTransactionPath([])
}
}, [daoAddress, onClose, repos, wrapper])
}, [knownUpgradableRepos, daoAddress, onClose, wrapper])

return (
<SidePanel

0 comments on commit c3a17aa

Please sign in to comment.
You can’t perform that action at this time.