Fix debuglogs window

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2025-07-02 11:59:04 -05:00 committed by GitHub
parent 8e5ebf6cc7
commit ef40b815c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,7 +68,7 @@ function getSubsystemColor(name: string): string {
let cachedPattern: RegExp | undefined;
if ('window' in global && window.localStorage) {
if (typeof window !== 'undefined' && window.localStorage) {
window.addEventListener('storage', event => {
if (event.key === 'debug') {
cachedPattern = undefined;
@ -82,10 +82,10 @@ function getPattern(): RegExp {
}
let value = '';
if ('window' in global && window.localStorage) {
if (typeof window !== 'undefined' && window.localStorage) {
value = window.localStorage.getItem('debug') || '';
}
if ('process' in global) {
if (typeof process !== 'undefined' && process.env) {
value = value || process.env.DEBUG || '';
}