Selenium webdriver wait for bootstrap modal fade

This is a similar question, however it is far out of date and for ruby. I need a solution for waiting on the bootstrap modal fade feature in selenium webdriver tests in javascript.

Presently, selenium reports that the button in the modal is not clickable due to the fade in. I have tried
await driver.wait(function() { return (modal.getCssValue('opacity') == 1); });
and similar, but either this technique is wrong or the code is flawed.

Source: Ask Javascript Questions