From be61b0bbb5c7aeaf4c9693480f7be94c988644eb Mon Sep 17 00:00:00 2001 From: meowarex Date: Fri, 3 Apr 2026 23:35:55 +1100 Subject: [PATCH] Fixed Null Assertions & Freed !important --- plugins/audio-visualizer-luna/src/audio.ts | 14 +++++++------- plugins/radiant-lyrics-luna/src/Settings.tsx | 2 +- plugins/radiant-lyrics-luna/src/index.ts | 10 +++------- plugins/radiant-lyrics-luna/src/styles.css | 2 +- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/plugins/audio-visualizer-luna/src/audio.ts b/plugins/audio-visualizer-luna/src/audio.ts index 6d29e3c..e194537 100644 --- a/plugins/audio-visualizer-luna/src/audio.ts +++ b/plugins/audio-visualizer-luna/src/audio.ts @@ -157,19 +157,19 @@ export const videoChanged = (): boolean => { }; export const sample = (): AudioData | null => { - if (!monoAnalyser || !monoByteFreq || !monoByteTime || !monoFloatFreq || !monoFloatTime || !leftFloatTime || !rightFloatTime) return null; + const ctx = audioContext; + if (!ctx || !monoAnalyser || !monoByteFreq || !monoByteTime || !monoFloatFreq || !monoFloatTime || !leftFloatTime || !rightFloatTime || !leftAnalyser || !rightAnalyser) return null; - // Recover from suspended context (can happen after tab becomes inactive) - if (audioContext?.state === "suspended") { - audioContext.resume().catch(() => {}); + if (ctx.state === "suspended") { + ctx.resume().catch(() => {}); } monoAnalyser.getByteFrequencyData(monoByteFreq); monoAnalyser.getByteTimeDomainData(monoByteTime); monoAnalyser.getFloatFrequencyData(monoFloatFreq); monoAnalyser.getFloatTimeDomainData(monoFloatTime); - leftAnalyser!.getFloatTimeDomainData(leftFloatTime); - rightAnalyser!.getFloatTimeDomainData(rightFloatTime); + leftAnalyser.getFloatTimeDomainData(leftFloatTime); + rightAnalyser.getFloatTimeDomainData(rightFloatTime); return { byteFrequency: monoByteFreq, @@ -178,7 +178,7 @@ export const sample = (): AudioData | null => { floatTimeDomain: monoFloatTime, leftTimeDomain: leftFloatTime, rightTimeDomain: rightFloatTime, - sampleRate: audioContext!.sampleRate, + sampleRate: ctx.sampleRate, fftSize: monoAnalyser.fftSize, binCount: monoAnalyser.frequencyBinCount, }; diff --git a/plugins/radiant-lyrics-luna/src/Settings.tsx b/plugins/radiant-lyrics-luna/src/Settings.tsx index 88bd7e5..a7fac68 100644 --- a/plugins/radiant-lyrics-luna/src/Settings.tsx +++ b/plugins/radiant-lyrics-luna/src/Settings.tsx @@ -411,7 +411,7 @@ export const Settings = () => { {playerBarBlur && ( { ); } else { footerPlayer.style.removeProperty("background-color"); - footerPlayer.style.setProperty( - "background", - "linear-gradient(rgba(60,60,60,0.35) 0%, rgba(60,60,60,0.35) 27%, rgba(61,61,61,0.35) 35%, rgba(62,62,62,0.35) 43.5%, rgba(63,63,63,0.35) 53%, rgba(65,65,65,0.35) 66%, rgba(67,67,67,0.35) 81%, rgba(70,70,70,0.35) 100%)", - "important", - ); + footerPlayer.style.removeProperty("background"); } if (settings.playerBarBlur) { footerPlayer.style.setProperty( @@ -167,8 +163,8 @@ const applyPlayerBarTintToElement = (): void => { "important", ); } else { - footerPlayer.style.setProperty("backdrop-filter", "none", "important"); - footerPlayer.style.setProperty("-webkit-backdrop-filter", "none", "important"); + footerPlayer.style.removeProperty("backdrop-filter"); + footerPlayer.style.removeProperty("-webkit-backdrop-filter"); } if (settings.floatingPlayerBar) { footerPlayer.style.setProperty( diff --git a/plugins/radiant-lyrics-luna/src/styles.css b/plugins/radiant-lyrics-luna/src/styles.css index 3f7aa90..f8b979e 100644 --- a/plugins/radiant-lyrics-luna/src/styles.css +++ b/plugins/radiant-lyrics-luna/src/styles.css @@ -324,7 +324,7 @@ body.rl-integrated-seekbar .rl-seekbar-bar:hover [data-test="progress-bar"] [dat /* MARKER: PATCHES (Random Fixes for Tidals Changes) */ -/* These change allot so i gave them their own section */ +/* These change a lot so I gave them their own section */ /* Remove max-width cap on now-playing content */ [class*="_contentInner"] {