electangular icon indicating copy to clipboard operation
electangular copied to clipboard

Possibly unhandled rejection: undefined

Open Jass91 opened this issue 7 years ago • 0 comments

Hi guys, I'm using Electangular and that's great, but, I tried to show a messagebox from angular, using this code:

electron.dialog.showMessageBox(null, {
    message: "Muito tempo inativo",
    title: "Inatividade",
     buttons  : ["Utilizar Tempo", "Ignorar Tempo"]
})
.then(
       function(r){
         debugger;
         console.log(r);
       },
     function(error){
       debugger;
       console.log(error);
});

when I click at 'Ignorar Tempo' labeled button, all goes fine, but when i click at 'Utilizar Tempo' button, an error occurs, but inside error variable, I have undefined value.

Obs: this occurs with any button at the first position in the buttons array, provided in the options object. I think it occurs, because the first position is 0, a falsy value and therefore we have this error on if clause.

image

Can you fix it? (just change if clause to if (result != 0 && !result) and it will be done)

Jass91 avatar May 04 '17 11:05 Jass91