Skip to content

Commit

Permalink
Merge pull request #81 from adshares/develop
Browse files Browse the repository at this point in the history
v0.4.5
  • Loading branch information
m-pilarczyk authored Nov 22, 2021
2 parents e58d2d5 + 98cb886 commit 92b0b8e
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 20 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.4.5] - 2021-11-22
### Added
- Unwrap link
### Removed
- New tab proxy option
### Fixed
- Missing secret key error

## [0.4.4] - 2021-11-15
### Changed
- Prevent importing accounts without keys
Expand Down Expand Up @@ -100,8 +109,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Storage encryption
- Docs

[Unreleased]: https://github.com/adshares/ads-browser-wallet/compare/v0.4.4...HEAD
[Unreleased]: https://github.com/adshares/ads-browser-wallet/compare/v0.4.5...HEAD

[0.4.5]: https://github.com/adshares/ads-browser-wallet/compare/v0.4.4...v0.4.5
[0.4.4]: https://github.com/adshares/ads-browser-wallet/compare/v0.4.3...v0.4.4
[0.4.3]: https://github.com/adshares/ads-browser-wallet/compare/v0.4.2...v0.4.3
[0.4.2]: https://github.com/adshares/ads-browser-wallet/compare/v0.4.1...v0.4.2
Expand Down
12 changes: 6 additions & 6 deletions app/components/atoms/Box.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.box hr {
background-color: var(--white);
border-color: var(--white);
}

.box.info {
Expand Down Expand Up @@ -42,7 +42,7 @@
}

.box.inverse hr {
background-color: var(--slate-dark);
border-color: var(--slate-dark);
}

.box.inverse > .icon {
Expand All @@ -55,7 +55,7 @@
}

.box.inverse.info hr {
background-color: var(--blue-dark);
border-color: var(--blue-dark);
}

.box.inverse.success {
Expand All @@ -64,7 +64,7 @@
}

.box.inverse.success hr {
background-color: var(--green-dark);
border-color: var(--green-dark);
}

.box.inverse.warning {
Expand All @@ -73,7 +73,7 @@
}

.box.inverse.warning hr {
background-color: var(--yellow-dark);
border-color: var(--yellow-dark);
}

.box.inverse.danger {
Expand All @@ -82,7 +82,7 @@
}

.box.inverse.danger hr {
background-color: var(--red-dark);
border-color: var(--red-dark);
}

.box .content {
Expand Down
1 change: 1 addition & 0 deletions app/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const config = {
privacyUrl: 'https://adshares.net/wallet.html#privacy',
attributionsUrl: 'https://adshares.net/wallet.html#attributions',
freeCoinsUrl: 'https://github.com/adshares/ads/wiki/How-to-join-the-Testnet#get-free-test-coins',
unwrapUrl: 'https://wallet.adshares.net/',
about: require('./about'),
terms: require('./terms'),
attributions: require('./attributions'),
Expand Down
4 changes: 2 additions & 2 deletions app/containers/Transactions/AuthenticateForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class AuthenticateForm extends SignForm {
}

static getDerivedStateFromProps(props, state) {
const { accounts, keys, selectedAccount, accountsLoaded } = props.vault;
const { accounts, keys, selectedAccount } = props.vault;
const account = accounts.find(
a => a.address === selectedAccount
);
Expand All @@ -30,7 +30,7 @@ export default class AuthenticateForm extends SignForm {
k => k.publicKey === account.publicKey
);
}
return { account, key, keyError: !key && accountsLoaded, };
return { account, key, keyError: !key };
}

getCommand() {
Expand Down
17 changes: 16 additions & 1 deletion app/containers/Transactions/AvailableGatewaysPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Page from '../../components/Page/Page';
import Box from '../../components/atoms/Box';
import ButtonLink from '../../components/atoms/ButtonLink';
import PageComponent from '../../components/PageComponent';
import config from '../../config/config';

class AvailableGatewaysPage extends PageComponent {
static propTypes = {
Expand All @@ -30,7 +31,9 @@ class AvailableGatewaysPage extends PageComponent {
{gateways.map(gateway =>
<ButtonLink
key={gateway.code}
icon="left" layout="info" inverse
icon="left"
layout="info"
inverse
to={{
pathname: `/transactions/gateways/${gateway.code}`,
state: { referrer: this.props.history.location }
Expand All @@ -39,6 +42,18 @@ class AvailableGatewaysPage extends PageComponent {
<FontAwesomeIcon icon={faRandom} /> {gateway.name}
</ButtonLink>
)}
<hr className="dashed" />
<ButtonLink
className={style.unwrap}
icon="left"
layout="info"
external
target="_blank"
rel="noopener noreferrer"
href={config.unwrapUrl}
>
<FontAwesomeIcon icon={faRandom} /> Unwrap
</ButtonLink>
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions app/containers/Transactions/SignForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class SignForm extends FormComponent {
command,
dataError: !command,
key,
keyError: !key && vault.accountsLoaded,
keyError: !key,
};
}

Expand Down Expand Up @@ -494,7 +494,7 @@ export default class SignForm extends FormComponent {
return this.renderKeyErrorPage();
}

const showLoader = this.props.showLoader || !this.props.vault.accountsLoaded;
const showLoader = this.props.showLoader;

return (
<Page
Expand Down
10 changes: 10 additions & 0 deletions app/containers/Transactions/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,13 @@
.availableLinks > *:nth-child(odd) {

}

.availableLinks hr {
margin-bottom: 18px;
border-color: var(--blue-dark);
border-style: dashed;
}

.unwrap svg {
transform: rotatey(180deg);
}
8 changes: 5 additions & 3 deletions app/reducers/VaultReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const initialVault = {
seed: '',
keys: [],
keyCount: config.initKeysQuantity,
accountsLoaded: false,
accounts: [],
selectedAccount: null,
nodes: [],
Expand Down Expand Up @@ -244,11 +243,14 @@ export default function (vault = initialVault, action) {
...a,
...action.account
} : a);
return {

const updatedVault = {
...vault,
accountsLoaded: true,
accounts,
};

updatedVault.secret = VaultCrypt.save(updatedVault);
return updatedVault;
}

case RETRIEVE_NODES_DATA_IN_INTERVALS_SUCCESS: {
Expand Down
3 changes: 3 additions & 0 deletions app/utils/vaultcrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const KEY_NAME = 'n';
const ACCOUNTS = 'a';
const ACCOUNT_ADDRESS = 'a';
const ACCOUNT_NAME = 'n';
const ACCOUNT_PUBLIC_KEY = 'p';

function checkPassword(vault, password) {
try {
Expand Down Expand Up @@ -41,6 +42,7 @@ function encrypt(vault, password) {
{
[ACCOUNT_ADDRESS]: account.address,
[ACCOUNT_NAME]: account.name,
[ACCOUNT_PUBLIC_KEY]: account.publicKey,
}
)),
});
Expand Down Expand Up @@ -69,6 +71,7 @@ function decrypt(encryptedVault, password) {
{
address: account[ACCOUNT_ADDRESS],
name: account[ACCOUNT_NAME],
publicKey: account[ACCOUNT_PUBLIC_KEY],
}
)),
};
Expand Down
7 changes: 4 additions & 3 deletions chrome/extension/adswallet.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ a:hover {
}

hr {
border: none;
border: 0;
border-top: 1px solid var(--gray-dark);
background: none;
height: 1px;
background-color: var(--gray-dark);
}

code {
overflow-wrap: anywhere;
}
}
2 changes: 1 addition & 1 deletion chrome/extension/background/api_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function handleMessage(message, sourceId, callback) {
data: message.data,
time: (new Date()).toISOString(),
});
if (message.options.newTab) {
{
const network = message.testnet ? '/testnet' : '/mainnet';
const url = `window.html#${network}/transactions/${sourceId}/${message.id}/popup-sign`;
openInTheNewTab(url);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adshares/ads-browser-wallet",
"version": "0.4.4",
"version": "0.4.5",
"display-name": "ADS Wallet",
"description": "Secure identity vault for Adshares network.",
"private": true,
Expand Down

0 comments on commit 92b0b8e

Please sign in to comment.