From a4f90d6d01c2bb6780574c3cc91e5ed1e449ebd1 Mon Sep 17 00:00:00 2001 From: OutdatedGuy Date: Sun, 24 Jul 2022 18:59:43 +0530 Subject: [PATCH] REFACTOR: optimized code with null check (#395) --- lib/templates.dart | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/templates.dart b/lib/templates.dart index 029434d..2ae073a 100644 --- a/lib/templates.dart +++ b/lib/templates.dart @@ -519,14 +519,8 @@ const List _indexHtmlBrandingPicture = [ const String _webJS = ''' function removeSplashFromWeb() { - const elem = document.getElementById("splash"); - if (elem) { - elem.remove(); - } - const elem2 = document.getElementById("splash-branding"); - if (elem2) { - elem2.remove(); - } + document.getElementById("splash")?.remove(); + document.getElementById("splash-branding")?.remove(); document.body.style.background = "transparent"; } ''';