Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
Disable 'purchase credits' modal if in PhoneGap
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXyfir committed Mar 19, 2019
1 parent 78aab8d commit 942ade5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/components/panel/DrawerContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class _DrawerContent extends React.Component<WithStyles<typeof styles>> {
render() {
const { categories, user } = this.context;
const { classes } = this.props;
const phonegap = /source~phonegap/.test(localStorage.r);
return (
<div>
<List>
Expand All @@ -62,7 +63,10 @@ class _DrawerContent extends React.Component<WithStyles<typeof styles>> {
<ListItemText primary="Account" />
</ListItem>
</a>
<Link to="/app/credits" className={classes.link}>
<Link
to={phonegap ? '/app' : '/app/credits'}
className={classes.link}
>
<ListItem button>
<ListItemIcon>
<Money />
Expand Down
3 changes: 3 additions & 0 deletions web/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ declare global {
}
}

if (location.search.startsWith('?r='))
localStorage.r = location.search.substr(3);

render(React.createElement(hot(App)), document.getElementById('content'));

0 comments on commit 942ade5

Please sign in to comment.