fix(slides): undefined error is no longer thrown after destroying and quickly re-creating ion-slides (#23239)

resolves #22289
This commit is contained in:
Liam DeBeasi
2021-04-26 12:25:23 -04:00
committed by GitHub
parent dab927d290
commit 2ccaabb5b4

View File

@ -39,8 +39,10 @@ export class Slides implements ComponentInterface {
async optionsChanged() { async optionsChanged() {
if (this.swiperReady) { if (this.swiperReady) {
const swiper = await this.getSwiper(); const swiper = await this.getSwiper();
Object.assign(swiper.params, this.options); if (swiper?.params) {
await this.update(); Object.assign(swiper.params, this.options);
await this.update();
}
} }
} }