Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.29.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
yknl committed May 31, 2018
2 parents 3aaf437 + a033a57 commit 4b90a3a
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /src/blockstack-browser
RUN apt-get update && apt-get install -y wget curl apt-utils git

# Install node
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y nodejs

# Install cors-proxy
Expand Down
2 changes: 1 addition & 1 deletion app/js/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ class AuthPage extends React.Component {

return (
<React.Fragment>
<ShellParent app={app} views={views} {...componentProps} />
<ShellParent app={app} views={views} {...componentProps} maxHeight />
<AppHomeWrapper />
</React.Fragment>
)
Expand Down
12 changes: 9 additions & 3 deletions app/js/auth/views/initial.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const Accounts = ({ list, handleClick, processing, selectedIndex }) => {
id={ownerAddress}
onClick={() => handleClick(i)}
loading={processing && i === selectedIndex}
placeholder="Logging in..."
disabled={processing}
placeholder="Signing in..."
hideID
/>
))
Expand All @@ -24,7 +25,12 @@ const Accounts = ({ list, handleClick, processing, selectedIndex }) => {

const PermissionsList = ({ list }) => (
<React.Fragment>
{list.map((item, i) => {
{list.length === 1 ?
<React.Fragment>
<strong>{list[0]}</strong>
</React.Fragment>
:
list.map((item, i) => {
if (i !== list.length - 1) {
return (
<React.Fragment key={i}>
Expand Down Expand Up @@ -88,7 +94,7 @@ const InitialScreen = ({
permissions={generatePermissionsList()}
app={app}
/>
<Buttons column>
<Buttons column overflow>
<Accounts
list={accounts}
handleClick={login}
Expand Down
3 changes: 2 additions & 1 deletion app/js/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const formatAppManifest = manifest => {
const asyncLocalStorage = {
setItem: (key, value) =>
Promise.resolve().then(() => localStorage.setItem(key, value)),
getItem: key => Promise.resolve().then(() => localStorage.getItem(key))
getItem: key => Promise.resolve().then(() => localStorage.getItem(key)),
removeItem: key => Promise.resolve().then(() => localStorage.removeItem(key))
}

export { formatAppManifest, asyncLocalStorage }
26 changes: 26 additions & 0 deletions app/js/components/ui/components/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import styled, { css } from 'styled-components'
import { trans } from '@ui/common'
import { spacing } from '@ui/common/constants'
import { Link } from 'react-router'
import { darken } from 'polished'
const Label = styled.div`
font-style: normal;
font-weight: 400;
Expand Down Expand Up @@ -249,6 +250,31 @@ StyledButton.Div = StyledButton.withComponent('div')
StyledButton.Link = StyledButton.withComponent(Link)

const Buttons = styled.div`
${({ overflow }) =>
overflow &&
css`
overflow-y: auto;
max-height: 100%;
flex-grow: 1;
background: ${darken(0.025, 'whitesmoke')};
border-radius: 10px;
padding: 20px 10px;
&::-webkit-scrollbar {
width: 10px;
}
&::-webkit-scrollbar-track {
-webkit-box-shadow: none;
background: ${darken(0.025, 'whitesmoke')};
border-radius: 10px;
}
&::-webkit-scrollbar-thumb {
background-color: darkgrey;
outline: 1px solid slategrey;
border-radius: 10px;
}
`};
* {
text-decoration: none !important;
}
Expand Down
19 changes: 18 additions & 1 deletion app/js/components/ui/components/shell/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const TitleSection = styled.div`
const AnimatedTitle = styled(animated.div)``
const Content = styled(animated.div)`
flex-grow: ${({ grow }) => (grow ? 1 : 0)};
display: flex;
flex-direction: column;
}
`
const Actions = styled(animated.div)`
@media (max-width: 599px) {
Expand All @@ -47,7 +50,11 @@ const Main = styled(animated.div)`
display: flex;
flex-direction: column;
position: relative;
width: 100%;
@media (max-height: 700px) and (max-width: 599px) {
flex-shrink: 0;
}
`
const Wrapper = styled(animated.div)`
position: absolute;
Expand Down Expand Up @@ -142,6 +149,16 @@ const StyledShell = styled.div`
z-index: 900000;
background-color: rgba(240, 240, 240, 0.8);
${({ maxHeight }) =>
maxHeight &&
css`
${ContentContainer} {
@media (min-width: 600px) {
max-height: calc(100vh - 120px) !important;
}
}
`};
${({ invert }) =>
invert
? css`
Expand Down Expand Up @@ -189,7 +206,7 @@ const StyledShell = styled.div`
padding: 60px;
}
@media (max-height: 7px) {
@media (max-height: 700px) {
align-items: flex-start;
}
Expand Down
4 changes: 3 additions & 1 deletion app/js/components/ui/containers/shell-parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ShellParent extends React.Component {
disableBack,
size,
view,
maxHeight,
...rest
} = this.props

Expand Down Expand Up @@ -130,7 +131,7 @@ class ShellParent extends React.Component {
<WindowSize>
{windowSize => (
<ShellContext.Provider value={{ ...context, size: windowSize }}>
<Shell {...context} {...windowSize}>
<Shell {...context} {...windowSize} maxHeight={maxHeight}>
<Shell.Content.Container {...windowSize}>
<Shell.Content.Wrapper {...windowSize}>
<Header
Expand Down Expand Up @@ -162,6 +163,7 @@ ShellParent.propTypes = {
views: PropTypes.array.isRequired,
disableBackOnView: PropTypes.number,
disableBack: PropTypes.bool,
maxHeight: PropTypes.bool,
size: PropTypes.object,
view: PropTypes.number
}
Expand Down
7 changes: 3 additions & 4 deletions app/js/sign-in/views/_initial.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ const InitialSignInScreen = ({ next, ...rest }) => {
children: (
<React.Fragment>
<Type.p>
Scan or copy/paste your Magic Recovery Code (we sent it to you when
you created your ID) or Secret Recovery Key (those 12 words you
recorded).
Enter your Magic Recovery Code (we sent it to you when you created your ID)
or Secret Recovery Key (those 12 words you recorded).
</Type.p>
<Type.p>
You’ll also need your password (the password you entered when the
You’ll also need your password (the password you entered when the
Magic Recovery Code was created).
</Type.p>
</React.Fragment>
Expand Down
10 changes: 6 additions & 4 deletions app/js/sign-up/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,20 @@ class Onboarding extends React.Component {
return null
}

const fullUsername = `${username}.${SUBDOMAIN_SUFFIX}`

const b64EncryptedBackupPhrase = new Buffer(
encryptedBackupPhrase,
'hex'
).toString('base64')

if (type === 'recovery') {
await this.sendRecovery(username, email, b64EncryptedBackupPhrase)
await this.sendRecovery(fullUsername, email, b64EncryptedBackupPhrase)
} else if (type === 'restore') {
await this.sendRestore(username, email, b64EncryptedBackupPhrase)
await this.sendRestore(fullUsername, email, b64EncryptedBackupPhrase)
} else {
await this.sendRestore(username, email, b64EncryptedBackupPhrase)
await this.sendRecovery(username, email, b64EncryptedBackupPhrase)
await this.sendRestore(fullUsername, email, b64EncryptedBackupPhrase)
await this.sendRecovery(fullUsername, email, b64EncryptedBackupPhrase)
}

return this.setState({
Expand Down
46 changes: 37 additions & 9 deletions app/js/update/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
migrateAPIEndpoints,
updateState
} from '../store/reducers'
import { formatAppManifest } from '@common'
import { asyncLocalStorage, formatAppManifest } from '@common'
import { BLOCKSTACK_STATE_VERSION_KEY } from '../App'
import {
hasLegacyCoreStateVersion,
Expand Down Expand Up @@ -105,6 +105,12 @@ class UpdatePage extends React.Component {
view: VIEWS.NOUPDATE
})
}

if (!this.props.encryptedBackupPhrase) {
this.updateStateVersionAndResetOldPersistedData().then(() =>
this.props.router.push('/sign-up')
)
}
}

/**
Expand Down Expand Up @@ -231,7 +237,14 @@ class UpdatePage extends React.Component {
{
complete: true
},
() => setTimeout(() => this.updateStateVersion(), 250)
() =>
setTimeout(
() =>
this.updateStateVersion().then(() =>
this.setDefaultIdentityAndRedirectHome()
),
250
)
)
}

Expand All @@ -247,8 +260,27 @@ class UpdatePage extends React.Component {
console.debug(
`updateStateVersion: Setting new state version to ${CURRENT_VERSION}`
)
localStorage.setItem(BLOCKSTACK_STATE_VERSION_KEY, CURRENT_VERSION)
await asyncLocalStorage.setItem(
BLOCKSTACK_STATE_VERSION_KEY,
CURRENT_VERSION
)
}

updateStateVersionAndResetOldPersistedData = async () => {
console.debug(
`updateStateVersionAndResetOldPersistedData: Setting new state version to ${CURRENT_VERSION}`
)
await asyncLocalStorage.setItem(
BLOCKSTACK_STATE_VERSION_KEY,
CURRENT_VERSION
)
console.debug(
'updateStateVersionAndResetOldPersistedData: removing old persisted data'
)
await asyncLocalStorage.removeItem('redux')
}

setDefaultIdentityAndRedirectHome = async () => {
this.props.setDefaultIdentity(this.state.defaultIdentityIndex)
this.setState({
view: VIEWS.SUCCESS
Expand All @@ -274,11 +306,6 @@ class UpdatePage extends React.Component {
}
}

setPassword = password =>
this.setState({
password
})

render() {
const { view } = this.state

Expand Down Expand Up @@ -307,6 +334,7 @@ class UpdatePage extends React.Component {
errors: this.state.errors,
handleSubmit: this.handleSubmit,
upgradeInProgress: this.state.upgradeInProgress,
updateStateVersion: this.updateStateVersion,
...currentViewProps.props
}
return (
Expand All @@ -315,7 +343,7 @@ class UpdatePage extends React.Component {
app={formatAppManifest(this.props.appManifest)}
views={views}
{...componentProps}
headerLabel="Finish updating Blockstack"
headerLabel="Blockstack Browser"
lastHeaderLabel="Update Complete"
invertOnLast
disableBackOnView={1}
Expand Down
14 changes: 12 additions & 2 deletions app/js/update/views/initial.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,18 @@ class PasswordView extends React.Component {

const props = {
title: {
children: 'Enter your password',
variant: 'h2'
children: 'We have updated the browser.',
variant: 'h2',
subtitle: {
light: true,
padding: '15px 0 0 0',
children: (
<React.Fragment>
Please enter your password to migrate your data to the new
version.
</React.Fragment>
)
}
},
content: {
grow: 0,
Expand Down
7 changes: 5 additions & 2 deletions app/js/update/views/no-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'

class NoUpdate extends React.Component {
componentDidMount() {
setTimeout(() => this.props.finish(), 3000)
setTimeout(() => this.props.finish(), 3500)
}

render() {
Expand All @@ -31,7 +31,10 @@ class NoUpdate extends React.Component {
{
label: <React.Fragment>Continue</React.Fragment>,
primary: true,
onClick: () => finish()
onClick: () => finish(),
loading: true,
placeholder: 'Redirecting...',
disabled: true
}
]
}
Expand Down
7 changes: 5 additions & 2 deletions app/js/update/views/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'

class Success extends React.Component {
componentDidMount() {
setTimeout(() => this.props.finish(), 8000)
setTimeout(() => this.props.finish(), 3500)
}

render() {
Expand All @@ -31,7 +31,10 @@ class Success extends React.Component {
{
label: <React.Fragment>Continue</React.Fragment>,
primary: true,
onClick: () => finish()
onClick: () => finish(),
loading: true,
placeholder: 'Redirecting...',
disabled: true
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions native/macos/Blockstack/Blockstack/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.29.0</string>
<string>0.29.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>95</string>
<string>96</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Loading

0 comments on commit 4b90a3a

Please sign in to comment.