From 3e548bbc9483596c38c6f62dff952dcb190c59c6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 15 Oct 2020 16:57:07 +0100 Subject: [PATCH] tidy Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LeftPanel.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index b978b7c93d..1d8a3e9912 100644 --- a/src/components/structures/LeftPanel.tsx +++ b/src/components/structures/LeftPanel.tsx @@ -121,10 +121,9 @@ export default class LeftPanel extends React.Component { } const avatarUrlProp = `url(${avatarUrl})`; - const existingValue = document.body.style.getPropertyValue("--avatar-url"); - if (!avatarUrl && existingValue) { + if (!avatarUrl) { document.body.style.removeProperty("--avatar-url"); - } else if (avatarUrl && existingValue !== avatarUrlProp) { + } else if (avatarUrl && document.body.style.getPropertyValue("--avatar-url") !== avatarUrlProp) { document.body.style.setProperty("--avatar-url", avatarUrlProp); } };