Ensure that both window and SignalWindow are defined

This commit is contained in:
Josh Perez 2021-09-20 13:29:37 -04:00 committed by GitHub
parent e86a6119cd
commit 1b9d8dcb11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 8 deletions

View file

@ -17,8 +17,7 @@ export function setupI18n(
const getMessage: LocalizerType = (key, substitutions) => {
// eslint-disable-next-line no-console
const log =
typeof window !== 'undefined' ? window.SignalWindow.log : console;
const log = window?.SignalWindow?.log || console;
const entry = messages[key];
if (!entry) {