File tree Expand file tree Collapse file tree 3 files changed +5328
-4
lines changed Expand file tree Collapse file tree 3 files changed +5328
-4
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,15 @@ const usabilla = new Usabilla(args[0], args[1]);
1010// Get all buttons for this account.
1111usabilla . websites . buttons . get ( ) . then ( ( buttons ) => {
1212
13+ const button = buttons [ 1 ] ;
14+
15+ if ( ! button ) {
16+ return ;
17+ }
18+
1319 // Use the button id to get feedback for this button id.
1420 let buttonFeedbackQuery = {
15- id : buttons [ 0 ] . id ,
21+ id : button . id ,
1622 params : {
1723 limit : 10
1824 }
@@ -30,9 +36,15 @@ usabilla.websites.buttons.get().then((buttons) => {
3036// Get all campaigns for this account.
3137usabilla . websites . campaigns . get ( ) . then ( ( campaigns ) => {
3238
39+ const campaign = campaigns [ 0 ] ;
40+
41+ if ( ! campaign ) {
42+ return ;
43+ }
44+
3345 // Get the results for a campaign with id.
3446 let campaignQuery = {
35- id : campaigns [ 0 ] . id
47+ id : campaign . id
3648 } ;
3749
3850 // Get the responses of the first campaign
@@ -86,9 +98,15 @@ usabilla.email.widgets.get().then((emailWidgets) => {
8698// Get all apps forms for this account.
8799usabilla . apps . forms . get ( ) . then ( ( appsForms ) => {
88100
101+ const appsForm = appsForms [ 1 ] ;
102+
103+ if ( ! appsForm ) {
104+ return ;
105+ }
106+
89107 // Get the feedback for a apps form with id.
90108 let appsQuery = {
91- id : appsForms [ 1 ] . id
109+ id : appsForm . id
92110 } ;
93111
94112 // Get the feedback of the second app form
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const browserify = require('browserify');
44const babelify = require ( 'babelify' ) ;
55
66const paths = {
7- src : './src' ,
7+ src : './src/**/*.js ' ,
88 dist : './dist' ,
99 entry : './src/index.js' ,
1010 filename : 'index.js' ,
You can’t perform that action at this time.
0 commit comments