From 4add599f8e3f802822ded5cce8f0436713078fb3 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:45:12 +0700 Subject: [PATCH] Optimize classList.remove() --- better-xcloud.user.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index ede929f..087e956 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -3485,8 +3485,7 @@ class Toast { } const classList = Toast.#$wrapper.classList; - classList.remove('bx-offscreen'); - classList.remove('bx-hide'); + classList.remove('bx-offscreen', 'bx-hide'); classList.add('bx-show'); } @@ -3506,8 +3505,7 @@ class Toast { Toast.#$wrapper.addEventListener('transitionend', e => { const classList = Toast.#$wrapper.classList; if (classList.contains('bx-hide')) { - classList.remove('bx-show'); - classList.remove('bx-hide'); + classList.remove('bx-offscreen', 'bx-hide'); classList.add('bx-offscreen'); } });