Skip to content

Commit 41c25d0

Browse files
committed
Revert "Detect when an app is unreachable and show a useful error message"
This reverts commit 012eb04.
1 parent 012eb04 commit 41c25d0

File tree

2 files changed

+11
-41
lines changed

2 files changed

+11
-41
lines changed

dashboard/Apps/AppsIndex.react.js

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,17 @@ let Metric = (props) => {
6363
let AppCard = ({
6464
app,
6565
icon,
66-
}) => {
67-
let canBrowse = app.serverInfo.error ? null : () => history.pushState(null, html`/apps/${app.slug}/browser`);
68-
let versionMessage = app.serverInfo.error ?
69-
<div className={styles.serverVersion}>Server not reachable: <span className={styles.ago}>{app.serverInfo.error.toString()}</span></div>:
70-
<div className={styles.serverVersion}>Server version: <span className={styles.ago}>{app.serverInfo.parseServerVersion || 'unknown'}</span></div>;
71-
72-
return <li onClick={canBrowse}>
73-
{icon ? <a className={styles.icon}><img src={icon} /></a> : null}
74-
<CountsSection className={styles.glance} title='At a glance'>
75-
<Metric number={dash(app.users, prettyNumber(app.users))} label='total users' />
76-
<Metric number={dash(app.installations, prettyNumber(app.installations))} label='total installations' />
77-
</CountsSection>
78-
<div className={styles.details}>
79-
<a className={styles.appname}>{app.name}</a>
80-
{versionMessage}
81-
</div>
82-
</li>
83-
}
66+
}) => <li onClick={() => history.pushState(null, html`/apps/${app.slug}/browser`)}>
67+
{icon ? <a className={styles.icon}><img src={icon} /></a> : null}
68+
<CountsSection className={styles.glance} title='At a glance'>
69+
<Metric number={dash(app.users, prettyNumber(app.users))} label='total users' />
70+
<Metric number={dash(app.installations, prettyNumber(app.installations))} label='total installations' />
71+
</CountsSection>
72+
<div className={styles.details}>
73+
<a className={styles.appname}>{app.name}</a>
74+
<div className={styles.serverVersion}>Server version: <span className={styles.ago}>{app.serverInfo.parseServerVersion || 'unknown'}</span></div>
75+
</div>
76+
</li>
8477

8578
export default class AppsIndex extends React.Component {
8679
constructor() {

dashboard/Dashboard.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,29 +139,6 @@ class Dashboard extends React.Component {
139139
).then(serverInfo => {
140140
app.serverInfo = serverInfo;
141141
return app;
142-
}, error => {
143-
if (error.code === 100) {
144-
app.serverInfo = {
145-
error: 'unable to connect to server',
146-
enabledFeatures: {},
147-
parseServerVersion: "unknown"
148-
}
149-
return Parse.Promise.as(app);
150-
} else if (error.code === 107) {
151-
app.serverInfo = {
152-
error: 'server version too low',
153-
enabledFeatures: {},
154-
parseServerVersion: "unknown"
155-
}
156-
return Parse.Promise.as(app);
157-
} else {
158-
app.serverInfo = {
159-
error: 'unknown error',
160-
enabledFeatures: {},
161-
parseServerVersion: "unknown"
162-
}
163-
return Parse.Promise.as(app);
164-
}
165142
});
166143
}
167144
});

0 commit comments

Comments
 (0)