Skip to content

Commit

Permalink
Merge pull request #1192 from aeternity/feature/hide-browser-cordova-ios
Browse files Browse the repository at this point in the history
Cordova iOS: Hide aepp browser and account access
  • Loading branch information
CedrikNikita authored Sep 19, 2019
2 parents 591ea00 + a75806d commit 79b8b53
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
16 changes: 14 additions & 2 deletions src/components/mobile/TabBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<ConnectionStatus />

<div class="wrapper">
<ButtonPlain :to="browserPath || { name: 'apps' }">
<ButtonPlain
v-if="!$globals.DISABLED_BROWSER"
:to="browserPath || { name: 'apps' }"
>
<Grid />
<div>{{ $t('app.title') }}</div>
</ButtonPlain>
Expand All @@ -13,6 +16,14 @@
<div>{{ $t('transfer.title') }}</div>
</ButtonPlain>

<ButtonPlain
v-if="$globals.DISABLED_BROWSER"
:to="{ name: 'transaction-list' }"
>
<List />
<div>{{ $t('transfer.transaction.title') }}</div>
</ButtonPlain>

<ButtonPlain
:class="showAccountSwitcher ? 'router-link-active' : ''"
@click="accountSwitcher"
Expand All @@ -37,7 +48,7 @@
import { mapState, mapGetters } from 'vuex';
import ButtonPlain from '../ButtonPlain.vue';
import {
Grid, Transfer, Contacts, Settings,
Grid, Transfer, List, Contacts, Settings,
} from '../icons';
import AeIdenticon from '../AeIdenticon.vue';
import ConnectionStatus from '../ConnectionStatus.vue';
Expand All @@ -49,6 +60,7 @@ export default {
ButtonPlain,
Grid,
Transfer,
List,
Contacts,
Settings,
ConnectionStatus,
Expand Down
6 changes: 6 additions & 0 deletions src/lib/initEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ Object.assign(process.env, {
RUNNING_IN_POPUP: !!window.opener && window.name === 'popup',
},
});

Object.assign(process.env, {
...process.env.DISABLED_BROWSER === undefined && {
DISABLED_BROWSER: process.env.IS_CORDOVA && process.env.IS_IOS,
},
});
2 changes: 1 addition & 1 deletion src/pages/mobile/Onboarding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {
stepRouteNames: [
'onboarding',
'onboarding-send',
'onboarding-aepps',
...process.env.DISABLED_BROWSER ? [] : ['onboarding-aepps'],
'onboarding-subaccounts',
],
}),
Expand Down
1 change: 1 addition & 0 deletions src/pages/mobile/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<LeftMore slot="right" />
</ListItem>
<ListItem
v-if="!$globals.DISABLED_BROWSER"
:to="{ name: 'settings-app-list' }"
:title="$t('app.settings.title')"
:subtitle="$tc('app.settings.count', appsAccountAccessCount)"
Expand Down
1 change: 1 addition & 0 deletions src/pages/mobile/Transfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<LeftMore slot="right" />
</ListItem>
<ListItem
v-if="!$globals.DISABLED_BROWSER"
:to="{ name: 'transaction-list' }"
:title="$t('transfer.transaction.title')"
:subtitle="$t('transfer.transaction.subtitle')"
Expand Down
4 changes: 2 additions & 2 deletions src/router/routes/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ export default [{
props: true,
}, {
name: 'transaction-list',
path: '/transfer/transactions/:direction?',
path: `${process.env.DISABLED_BROWSER ? '' : '/transfer'}/transactions/:direction?`,
component: TransactionList,
beforeEnter: ensureLoggedIn,
props: true,
}, {
name: 'transaction-details',
path: '/transfer/transactions/details/:hash',
path: `${process.env.DISABLED_BROWSER ? '' : '/transfer'}/transactions/details/:hash`,
component: TransactionDetails,
beforeEnter: ensureLoggedIn,
props: true,
Expand Down
1 change: 1 addition & 0 deletions src/ui-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Vue.prototype.$globals = {
IS_IOS: process.env.IS_IOS,
UNFINISHED_FEATURES: process.env.UNFINISHED_FEATURES,
IS_CORDOVA: process.env.IS_CORDOVA,
DISABLED_BROWSER: process.env.DISABLED_BROWSER,
};

0 comments on commit 79b8b53

Please sign in to comment.