Use optional chaining for onMounted sidebar
Some checks failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed

This commit is contained in:
Norm 2022-08-07 20:38:13 -04:00
parent 5b83c8b2a1
commit 9f532e37e7
Signed by: norm
GPG key ID: 7123E30E441E80DE

View file

@ -78,7 +78,7 @@ watch(iconOnly, () => {
});
onMounted(() => {
if (sidebar && sidebar.parentElement) {
if (sidebar?.parentElement) {
const sticky = new StickySidebar(sidebar.parentElement, 16);
window.addEventListener('scroll', () => {
sticky.calc(window.scrollY);