0

I am calling a function which returns Promise.all.

applyFilterToSh = (sheet, name, value)=>{
  return sheet.applyFilterAsync(name, value, tableau.FilterUpdateType.REPLACE);
}

applyFilterToSheets = (name, value) => {
  let sheets = this.getActiveSheet().getWorksheets();
  return Promise.all(sheets.map((sheet)=>{
    return this.applyFilterToSh(sheet, name, value);
  }))
}

setDefaultFilters(){
this.applyFilterToSheets(filterValues[0].name, filterValues[0].values[0].formattedValue).then((s)=>{
        this.gFilters.setIsDashboardLoading(false);
        this.gFilters.setAllFilters(this.currentFiltersList);
      })
}

The success callback only fires if I open the browser console or if I close it.`

smitach
  • 11
  • 4
  • 1
    Do you still have console.log() statements ( or other console methods, like console.trace ) inside the code? If so, does removing those lines fix the issue? If so, have a look at https://stackoverflow.com/questions/7742781/why-does-javascript-only-work-after-opening-developer-tools-in-ie-once and the comments given there. You might have angular caching issues, you might be using a browser still affected by this bug, etc... – Shilly Jan 18 '19 at 15:05
  • Please provide the code where you call the function, etc. – Batajus Jan 18 '19 at 15:32
  • Modified my code - added the code where I make a call to applyFilterToSheets function – smitach Jan 18 '19 at 15:52
  • At first sight, it looks like correct code. Maybe something wrong in your `applyFilterAsync` method – Batajus Jan 18 '19 at 17:21
  • I noticed , it takes long time to get to the success callback. But the moment I open the console, it gets fired. Is this anything specific to Angular? – smitach Jan 18 '19 at 19:41

0 Answers0