From e6ed64cfd0006f5a8b59588d5e74ff20fc1f3a0c Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 17 Dec 2022 14:38:21 +0800 Subject: [PATCH] Fix auto display: none not working `this` probably refers to something else --- src/components/status.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index dc135046..d31f5f38 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -220,8 +220,10 @@ function Card({ card }) { height={height} loading="lazy" alt="" - onError={() => { - this.style.display = 'none'; + onError={(e) => { + try { + e.target.style.display = 'none'; + } catch (e) {} }} />