Skip to content

Commit 1e16c4f

Browse files
committed
Only show fiddles with title
The JSFiddle API seems to have changed a bit since and shows all fiddles rather than only public ones, so we now filter them by title.
1 parent af8c5fb commit 1e16c4f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

js/fiddle-app.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ class JSFiddleApp extends React.Component {
5858
if (this.props.limit) {
5959
this.apiURL += "&limit=" + this.props.limit;
6060
}
61-
this.getJSON(this.apiURL, (response) => {
61+
this.getJSON(this.apiURL, ({ list }) => {
62+
list = list.filter(i => i.title);
6263
this.setState({
63-
data: response.list,
64+
data: list,
6465
currentFiddle: {
65-
name: response.list[0].title,
66-
description: response.list[0].description,
67-
url: response.list[0].url,
66+
name: list[0].title,
67+
description: list[0].description,
68+
url: list[0].url,
6869
index: 0
6970
}
7071
});

0 commit comments

Comments
 (0)