Import log instead of using it off of window

This commit is contained in:
Josh Perez 2021-09-17 14:27:53 -04:00 committed by GitHub
parent 8eb0dd3116
commit 65ddf0a9e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 3654 additions and 3433 deletions

View file

@ -51,6 +51,7 @@ import {
getCallSelector,
} from './calling';
import { getAccountSelector, AccountSelectorType } from './accounts';
import * as log from '../../logging/log';
let placeholderContact: ConversationType;
export const getPlaceholderContact = (): ConversationType => {
@ -635,9 +636,7 @@ export const getConversationSelector = createSelector(
): GetConversationByIdType => {
return (id?: string) => {
if (!id) {
window.log.warn(
`getConversationSelector: Called with a falsey id ${id}`
);
log.warn(`getConversationSelector: Called with a falsey id ${id}`);
// This will return a placeholder contact
return selector(undefined);
}
@ -659,9 +658,7 @@ export const getConversationSelector = createSelector(
return selector(onId);
}
window.log.warn(
`getConversationSelector: No conversation found for id ${id}`
);
log.warn(`getConversationSelector: No conversation found for id ${id}`);
// This will return a placeholder contact
return selector(undefined);
};
@ -743,7 +740,7 @@ export const getContactNameColorSelector = createSelector(
);
const color = contactNameColors.get(contactId);
if (!color) {
window.log.warn(`No color generated for contact ${contactId}`);
log.warn(`No color generated for contact ${contactId}`);
return ContactNameColors[0];
}
return color;