Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
observeScrollbarStyle() {
this.subscriptions.add(
scrollbarStyle.observePreferredScrollbarStyle(style => {
switch (style) {
case 'legacy':
this.classList.remove('scrollbars-visible-when-scrolling');
this.classList.add('scrollbars-visible-always');
break;
case 'overlay':
this.classList.remove('scrollbars-visible-always');
this.classList.add('scrollbars-visible-when-scrolling');
break;
}
})
);
}