Skip to content

Commit

Permalink
alert to notie
Browse files Browse the repository at this point in the history
  • Loading branch information
timqian committed Jun 30, 2016
1 parent 3e34cb2 commit ff0fe4b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 19 deletions.
28 changes: 14 additions & 14 deletions dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

<footer>
<button id="clearBtn" >clear</button>
<a href="https://github.com/timqian/star-history-plugin">Chrome extension version of star-history</a>
<a href="https://github.com/timqian/star-history-plugin">Chrome extension</a>
<br/>
<a href="https://github.com/timqian/star-history/blob/gh-pages/README.md#updates">Updates</a>
</footer>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"license": "MIT",
"dependencies": {
"axios": "^0.9.1",
"corner-notie": "^1.2.0",
"d3": "^3.5.6",
"nvd3": "^1.8.1"
},
Expand Down
2 changes: 1 addition & 1 deletion src/getStarHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function generateUrls(repo) {

const initUrl = `https://api.github.com/repos/${repo}/stargazers`; // used to get star infors
const initRes = await axiosGit.get(initUrl).catch(res => {
throw 'No such repo or netowrk err!';
throw 'No such repo or netowrk error!';
});

/**
Expand Down
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import getStarHistory from './getStarHistory';
import draw from './draw';

import notie from 'corner-notie'
let data = [];

// fetch data accoding to hash
Expand Down Expand Up @@ -47,7 +47,13 @@ async function fetchDataAndDraw(repo) {
document.getElementById('theGif').style.display = 'inline';

const starHistory = await getStarHistory(repo).catch(err => {
alert(err);
notie(err, {
type: 'warning', // info | warning | success | danger
autoHide: true,
timeout: 3000,
position: 'bottom-center',
width: 300
})
document.getElementById('theBtn').removeAttribute("disabled");
document.getElementById('theGif').style.display = 'none';
});
Expand Down

0 comments on commit ff0fe4b

Please sign in to comment.