Replace console.warn with logger.warn
Related https://github.com/vector-im/element-web/issues/18425
This commit is contained in:
parent
5e73a212f4
commit
5290afcc4c
71 changed files with 195 additions and 127 deletions
|
@ -27,6 +27,8 @@ import MatrixClientContext from "../../contexts/MatrixClientContext";
|
|||
import AutoHideScrollbar from "./AutoHideScrollbar";
|
||||
import { ActionPayload } from "../../dispatcher/payloads";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IProps {
|
||||
// URL to request embedded page content from
|
||||
url?: string;
|
||||
|
@ -79,7 +81,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
|
|||
}
|
||||
|
||||
if (err || response.status < 200 || response.status >= 300) {
|
||||
console.warn(`Error loading page: ${err}`);
|
||||
logger.warn(`Error loading page: ${err}`);
|
||||
this.setState({ page: _t("Couldn't load page") });
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -917,7 +917,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
let waitFor = Promise.resolve(null);
|
||||
if (!this.firstSyncComplete) {
|
||||
if (!this.firstSyncPromise) {
|
||||
console.warn('Cannot view a room before first sync. room_id:', roomInfo.room_id);
|
||||
logger.warn('Cannot view a room before first sync. room_id:', roomInfo.room_id);
|
||||
return;
|
||||
}
|
||||
waitFor = this.firstSyncPromise.promise;
|
||||
|
@ -973,7 +973,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
// Wait for the first sync to complete
|
||||
if (!this.firstSyncComplete) {
|
||||
if (!this.firstSyncPromise) {
|
||||
console.warn('Cannot view a group before first sync. group_id:', groupId);
|
||||
logger.warn('Cannot view a group before first sync. group_id:', groupId);
|
||||
return;
|
||||
}
|
||||
await this.firstSyncPromise.promise;
|
||||
|
@ -1475,7 +1475,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
Modal.closeCurrentModal('Session.logged_out');
|
||||
|
||||
if (errObj.httpStatus === 401 && errObj.data && errObj.data['soft_logout']) {
|
||||
console.warn("Soft logout issued by server - avoiding data deletion");
|
||||
logger.warn("Soft logout issued by server - avoiding data deletion");
|
||||
Lifecycle.softLogout();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
|
|||
}
|
||||
this.setState({ protocolsLoading: false });
|
||||
}, (err) => {
|
||||
console.warn(`error loading third party protocols: ${err}`);
|
||||
logger.warn(`error loading third party protocols: ${err}`);
|
||||
this.setState({ protocolsLoading: false });
|
||||
if (MatrixClientPeg.get().isGuest()) {
|
||||
// Guests currently aren't allowed to use this API, so
|
||||
|
|
|
@ -312,7 +312,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
|||
//
|
||||
// for now, just warn about this. But we're going to end up paginating
|
||||
// both rooms separately, and it's all bad.
|
||||
console.warn("Replacing timelineSet on a TimelinePanel - confusion may ensue");
|
||||
logger.warn("Replacing timelineSet on a TimelinePanel - confusion may ensue");
|
||||
}
|
||||
|
||||
const differentEventId = newProps.eventId != this.props.eventId;
|
||||
|
@ -1266,7 +1266,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
|||
// Somehow, it seems to be possible for live events to not have
|
||||
// a timeline, even though that should not happen. :(
|
||||
// https://github.com/vector-im/element-web/issues/12120
|
||||
console.warn(
|
||||
logger.warn(
|
||||
`Event ${events[i].getId()} in room ${room.roomId} is live, ` +
|
||||
`but it does not have a timeline`,
|
||||
);
|
||||
|
|
|
@ -176,7 +176,7 @@ const CreateSpaceFromCommunityDialog: React.FC<IProps> = ({ matrixClient: cli, g
|
|||
const { servers } = await cli.getRoomIdForAlias(canonicalAlias);
|
||||
viaMap.set(roomId, servers);
|
||||
} catch (e) {
|
||||
console.warn("Failed to resolve alias during community migration", e);
|
||||
logger.warn("Failed to resolve alias during community migration", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ const CreateSpaceFromCommunityDialog: React.FC<IProps> = ({ matrixClient: cli, g
|
|||
_t("This community has been upgraded into a Space") + `</h1></a><br />`
|
||||
+ groupSummary.profile.long_description,
|
||||
} as IGroupSummary["profile"]).catch(e => {
|
||||
console.warn("Failed to update community profile during migration", e);
|
||||
logger.warn("Failed to update community profile during migration", e);
|
||||
});
|
||||
|
||||
onFinished(roomId);
|
||||
|
|
|
@ -158,7 +158,7 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
|
|||
// Our application lifecycle will catch the error and do the logout bits.
|
||||
// We'll try to log something in an vain attempt to record what happened (storage
|
||||
// is also obliterated on logout).
|
||||
console.warn("User's account got deactivated without confirmation: Server had no auth");
|
||||
logger.warn("User's account got deactivated without confirmation: Server had no auth");
|
||||
this.setState({ errStr: _t("Server did not require any authentication") });
|
||||
}).catch(e => {
|
||||
if (e && e.httpStatus === 401 && e.data) {
|
||||
|
|
|
@ -991,7 +991,7 @@ class SettingsExplorer extends React.PureComponent<IExplorerProps, ISettingsExpl
|
|||
const val = parsedExplicit[level];
|
||||
await SettingsStore.setValue(settingId, null, level as SettingLevel, val);
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
logger.warn(e);
|
||||
}
|
||||
}
|
||||
const roomId = this.props.room.roomId;
|
||||
|
@ -1001,7 +1001,7 @@ class SettingsExplorer extends React.PureComponent<IExplorerProps, ISettingsExpl
|
|||
const val = parsedExplicitRoom[level];
|
||||
await SettingsStore.setValue(settingId, roomId, level as SettingLevel, val);
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
logger.warn(e);
|
||||
}
|
||||
}
|
||||
this.setState({
|
||||
|
@ -1035,7 +1035,7 @@ class SettingsExplorer extends React.PureComponent<IExplorerProps, ISettingsExpl
|
|||
vals[level] = null;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
logger.warn(e);
|
||||
}
|
||||
}
|
||||
return JSON.stringify(vals, null, 4);
|
||||
|
|
|
@ -33,6 +33,8 @@ import {
|
|||
} from "./HostSignupDialogTypes";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
const HOST_SIGNUP_KEY = "host_signup";
|
||||
|
||||
interface IProps {}
|
||||
|
@ -146,7 +148,7 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
|
|||
private async sendAccountDetails() {
|
||||
const openIdToken = await MatrixClientPeg.get().getOpenIdToken();
|
||||
if (!openIdToken || !openIdToken.access_token) {
|
||||
console.warn("Failed to connect to homeserver for OpenID token.");
|
||||
logger.warn("Failed to connect to homeserver for OpenID token.");
|
||||
this.setState({
|
||||
completed: true,
|
||||
error: _t("Failed to connect to your homeserver. Please close this dialog and try again."),
|
||||
|
|
|
@ -470,7 +470,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
for (const member of otherMembers) {
|
||||
if (rooms[member.userId]) continue; // already have a room
|
||||
|
||||
console.warn(`Adding DM room for ${member.userId} as ${dmRoom.roomId} from tag, not DM map`);
|
||||
logger.warn(`Adding DM room for ${member.userId} as ${dmRoom.roomId} from tag, not DM map`);
|
||||
rooms[member.userId] = dmRoom;
|
||||
}
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
for (const userId in rooms) {
|
||||
// Filter out user IDs that are already in the room / should be excluded
|
||||
if (excludedTargetIds.has(userId)) {
|
||||
console.warn(`[Invite:Recents] Excluding ${userId} from recents`);
|
||||
logger.warn(`[Invite:Recents] Excluding ${userId} from recents`);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -487,7 +487,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
const member = room.getMember(userId);
|
||||
if (!member) {
|
||||
// just skip people who don't have memberships for some reason
|
||||
console.warn(`[Invite:Recents] ${userId} is missing a member object in their own DM (${room.roomId})`);
|
||||
logger.warn(`[Invite:Recents] ${userId} is missing a member object in their own DM (${room.roomId})`);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -507,13 +507,13 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
}
|
||||
if (!lastEventTs) {
|
||||
// something weird is going on with this room
|
||||
console.warn(`[Invite:Recents] ${userId} (${room.roomId}) has a weird last timestamp: ${lastEventTs}`);
|
||||
logger.warn(`[Invite:Recents] ${userId} (${room.roomId}) has a weird last timestamp: ${lastEventTs}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
recents.push({ userId, user: member, lastActive: lastEventTs });
|
||||
}
|
||||
if (!recents) console.warn("[Invite:Recents] No recents to suggest!");
|
||||
if (!recents) logger.warn("[Invite:Recents] No recents to suggest!");
|
||||
|
||||
// Sort the recents by last active to save us time later
|
||||
recents.sort((a, b) => b.lastActive - a.lastActive);
|
||||
|
@ -873,8 +873,8 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Non-fatal error trying to make an invite for a user ID");
|
||||
console.warn(e);
|
||||
logger.warn("Non-fatal error trying to make an invite for a user ID");
|
||||
logger.warn(e);
|
||||
|
||||
// Add a result anyways, just without a profile. We stick it at the
|
||||
// top so it is most obviously presented to the user.
|
||||
|
|
|
@ -176,7 +176,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
|||
const u = url.parse(this.props.app.url);
|
||||
const childContentProtocol = u.protocol;
|
||||
if (parentContentProtocol === 'https:' && childContentProtocol !== 'https:') {
|
||||
console.warn("Refusing to load mixed-content app:",
|
||||
logger.warn("Refusing to load mixed-content app:",
|
||||
parentContentProtocol, childContentProtocol, window.location, this.props.app.url);
|
||||
return true;
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
|||
dis.dispatch({ action: 'post_sticker_message', data: payload.data });
|
||||
dis.dispatch({ action: 'stickerpicker_close' });
|
||||
} else {
|
||||
console.warn('Ignoring sticker message. Invalid capability');
|
||||
logger.warn('Ignoring sticker message. Invalid capability');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ import dis from "../../../dispatcher/dispatcher";
|
|||
import { Action } from "../../../dispatcher/actions";
|
||||
import { UserTab } from "../dialogs/UserSettingsDialog";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
export enum WarningKind {
|
||||
Files,
|
||||
Search,
|
||||
|
@ -83,7 +85,7 @@ export default function DesktopBuildsNotice({ isRoomEncrypted, kind }: IProps) {
|
|||
|
||||
// for safety
|
||||
if (!text) {
|
||||
console.warn("Unknown desktop builds warning kind: ", kind);
|
||||
logger.warn("Unknown desktop builds warning kind: ", kind);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@ import ICanvasEffect from '../../../effects/ICanvasEffect';
|
|||
import { CHAT_EFFECTS } from '../../../effects';
|
||||
import UIStore, { UI_EVENTS } from "../../../stores/UIStore";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IProps {
|
||||
roomWidth: number;
|
||||
}
|
||||
|
@ -38,7 +40,7 @@ const EffectsOverlay: FunctionComponent<IProps> = ({ roomWidth }) => {
|
|||
effect = new Effect(options);
|
||||
effectsRef.current[name] = effect;
|
||||
} catch (err) {
|
||||
console.warn(`Unable to load effect module at '../../../effects/${name}.`, err);
|
||||
logger.warn(`Unable to load effect module at '../../../effects/${name}.`, err);
|
||||
}
|
||||
}
|
||||
return effect;
|
||||
|
|
|
@ -33,6 +33,8 @@ import SettingsStore from "../../../settings/SettingsStore";
|
|||
import { mediaFromMxc } from "../../../customisations/Media";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
// A class for a child of GroupFilterPanel (possibly wrapped in a DNDTagTile) that represents
|
||||
// a thing to click on for the user to filter the visible rooms in the RoomList to:
|
||||
// - Rooms that are part of the group
|
||||
|
@ -85,7 +87,7 @@ export default class TagTile extends React.Component {
|
|||
if (this.unmounted) return;
|
||||
this.setState({ profile });
|
||||
}).catch((err) => {
|
||||
console.warn('Could not fetch group profile for ' + this.props.tag, err);
|
||||
logger.warn('Could not fetch group profile for ' + this.props.tag, err);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ import { PlaybackManager } from "../../../audio/PlaybackManager";
|
|||
import { isVoiceMessage } from "../../../utils/EventUtils";
|
||||
import { PlaybackQueue } from "../../../audio/PlaybackQueue";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IState {
|
||||
error?: Error;
|
||||
playback?: Playback;
|
||||
|
@ -49,12 +51,12 @@ export default class MAudioBody extends React.PureComponent<IBodyProps, IState>
|
|||
buffer = await blob.arrayBuffer();
|
||||
} catch (e) {
|
||||
this.setState({ error: e });
|
||||
console.warn("Unable to decrypt audio message", e);
|
||||
logger.warn("Unable to decrypt audio message", e);
|
||||
return; // stop processing the audio file
|
||||
}
|
||||
} catch (e) {
|
||||
this.setState({ error: e });
|
||||
console.warn("Unable to decrypt/download audio message", e);
|
||||
logger.warn("Unable to decrypt/download audio message", e);
|
||||
return; // stop processing the audio file
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ export default class MFileBody extends React.Component<IProps, IState> {
|
|||
decryptedBlob: await this.props.mediaEventHelper.sourceBlob.value,
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn("Unable to decrypt attachment: ", err);
|
||||
logger.warn("Unable to decrypt attachment: ", err);
|
||||
Modal.createTrackedDialog('Error decrypting attachment', '', ErrorDialog, {
|
||||
title: _t("Error"),
|
||||
description: _t("Error decrypting attachment"),
|
||||
|
|
|
@ -34,6 +34,8 @@ import { IBodyProps } from "./IBodyProps";
|
|||
import classNames from 'classnames';
|
||||
import { CSSTransition, SwitchTransition } from 'react-transition-group';
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IState {
|
||||
decryptedUrl?: string;
|
||||
decryptedThumbnailUrl?: string;
|
||||
|
@ -275,7 +277,7 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
|
|||
});
|
||||
} catch (err) {
|
||||
if (this.unmounted) return;
|
||||
console.warn("Unable to decrypt attachment: ", err);
|
||||
logger.warn("Unable to decrypt attachment: ", err);
|
||||
// Set a placeholder image when we can't decrypt the image.
|
||||
this.setState({
|
||||
error: err,
|
||||
|
|
|
@ -180,7 +180,7 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
|
|||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn("Unable to decrypt attachment: ", err);
|
||||
logger.warn("Unable to decrypt attachment: ", err);
|
||||
// Set a placeholder image when we can't decrypt the image.
|
||||
this.setState({
|
||||
error: err,
|
||||
|
|
|
@ -236,7 +236,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
|||
if (!device) {
|
||||
// This can happen if the device is logged out while we're still showing verification
|
||||
// UI for it.
|
||||
console.warn("Verified device we don't know about: " + this.props.request.channel.deviceId);
|
||||
logger.warn("Verified device we don't know about: " + this.props.request.channel.deviceId);
|
||||
description = _t("You've successfully verified your device!");
|
||||
} else {
|
||||
description = _t("You've successfully verified %(deviceName)s (%(deviceId)s)!", {
|
||||
|
|
|
@ -61,6 +61,8 @@ import MKeyVerificationConclusion from "../messages/MKeyVerificationConclusion";
|
|||
import { dispatchShowThreadEvent } from '../../../dispatcher/dispatch-actions/threads';
|
||||
import { MessagePreviewStore } from '../../../stores/room-list/MessagePreviewStore';
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
const eventTileTypes = {
|
||||
[EventType.RoomMessage]: 'messages.MessageEvent',
|
||||
[EventType.Sticker]: 'messages.MessageEvent',
|
||||
|
@ -974,7 +976,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
|||
// before trying to instantiate us
|
||||
if (!tileHandler) {
|
||||
const { mxEvent } = this.props;
|
||||
console.warn(`Event type not supported: type:${eventType} isState:${mxEvent.isState()}`);
|
||||
logger.warn(`Event type not supported: type:${eventType} isState:${mxEvent.isState()}`);
|
||||
return <div className="mx_EventTile mx_EventTile_info mx_MNoticeBody">
|
||||
<div className="mx_EventTile_line">
|
||||
{ _t('This event could not be displayed') }
|
||||
|
|
|
@ -48,6 +48,8 @@ import { shouldShowComponent } from "../../../customisations/helpers/UIComponent
|
|||
import { UIComponent } from "../../../settings/UIFeature";
|
||||
import { JoinRule } from "matrix-js-sdk/src/@types/partials";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
const getSearchQueryLSKey = (roomId: string) => `mx_MemberList_searchQuarry_${roomId}`;
|
||||
|
||||
const INITIAL_LOAD_NUM_MEMBERS = 30;
|
||||
|
@ -184,7 +186,7 @@ export default class MemberList extends React.Component<IProps, IState> {
|
|||
try {
|
||||
searchQuery = window.localStorage.getItem(getSearchQueryLSKey(this.props.roomId));
|
||||
} catch (error) {
|
||||
console.warn("Failed to get last the MemberList search query", error);
|
||||
logger.warn("Failed to get last the MemberList search query", error);
|
||||
}
|
||||
|
||||
// set the state after determining showPresence to make sure it's
|
||||
|
@ -433,7 +435,7 @@ export default class MemberList extends React.Component<IProps, IState> {
|
|||
try {
|
||||
window.localStorage.setItem(getSearchQueryLSKey(this.props.roomId), searchQuery);
|
||||
} catch (error) {
|
||||
console.warn("Failed to set the last MemberList search query", error);
|
||||
logger.warn("Failed to set the last MemberList search query", error);
|
||||
}
|
||||
|
||||
this.setState({
|
||||
|
|
|
@ -26,6 +26,8 @@ import { replaceableComponent } from "../../../utils/replaceableComponent";
|
|||
|
||||
import MemberAvatar from '../avatars/MemberAvatar';
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IProps {
|
||||
// the RoomMember to show the RR for
|
||||
member?: RoomMember;
|
||||
|
@ -145,7 +147,7 @@ export default class ReadReceiptMarker extends React.PureComponent<IProps, IStat
|
|||
// this seems to happen sometimes for reasons I don't understand
|
||||
// the docs for `offsetParent` say it may be null if `display` is
|
||||
// `none`, but I can't see why that would happen.
|
||||
console.warn(
|
||||
logger.warn(
|
||||
`ReadReceiptMarker for ${this.props.fallbackUserId} in has no offsetParent`,
|
||||
);
|
||||
startTopOffset = 0;
|
||||
|
|
|
@ -29,6 +29,8 @@ import { getEventDisplayInfo, isVoiceMessage } from '../../../utils/EventUtils';
|
|||
import MFileBody from "../messages/MFileBody";
|
||||
import MVoiceMessageBody from "../messages/MVoiceMessageBody";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IProps {
|
||||
mxEvent: MatrixEvent;
|
||||
permalinkCreator?: RoomPermalinkCreator;
|
||||
|
@ -107,7 +109,7 @@ export default class ReplyTile extends React.PureComponent<IProps> {
|
|||
// before trying to instantiate us
|
||||
if (!tileHandler) {
|
||||
const { mxEvent } = this.props;
|
||||
console.warn(`Event type not supported: type:${mxEvent.getType()} isState:${mxEvent.isState()}`);
|
||||
logger.warn(`Event type not supported: type:${mxEvent.getType()} isState:${mxEvent.isState()}`);
|
||||
return <div className="mx_ReplyTile mx_ReplyTile_info mx_MNoticeBody">
|
||||
{ _t('This event could not be displayed') }
|
||||
</div>;
|
||||
|
|
|
@ -50,6 +50,8 @@ import IconizedContextMenu, {
|
|||
import { CommunityPrototypeStore, IRoomProfile } from "../../../stores/CommunityPrototypeStore";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IProps {
|
||||
room: Room;
|
||||
showMessagePreview: boolean;
|
||||
|
@ -299,7 +301,7 @@ export default class RoomTile extends React.PureComponent<IProps, IState> {
|
|||
0,
|
||||
));
|
||||
} else {
|
||||
console.warn(`Unexpected tag ${tagId} applied to ${this.props.room.roomId}`);
|
||||
logger.warn(`Unexpected tag ${tagId} applied to ${this.props.room.roomId}`);
|
||||
}
|
||||
|
||||
if ((ev as React.KeyboardEvent).key === Key.ENTER) {
|
||||
|
|
|
@ -113,7 +113,7 @@ export default class Stickerpicker extends React.PureComponent<IProps, IState> {
|
|||
logger.error("Cannot disable assets: no scalar client");
|
||||
}
|
||||
} else {
|
||||
console.warn('No widget ID specified, not disabling assets');
|
||||
logger.warn('No widget ID specified, not disabling assets');
|
||||
}
|
||||
|
||||
this.props.setShowStickers(false);
|
||||
|
|
|
@ -27,6 +27,8 @@ import { isUrlPermitted } from '../../../HtmlUtils';
|
|||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { mediaFromMxc } from "../../../customisations/Media";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IProps {
|
||||
ev: MatrixEvent;
|
||||
room: Room;
|
||||
|
@ -75,13 +77,13 @@ export default class BridgeTile extends React.PureComponent<IProps> {
|
|||
const content: IBridgeStateEvent = this.props.ev.getContent();
|
||||
// Validate
|
||||
if (!content.channel?.id || !content.protocol?.id) {
|
||||
console.warn(`Bridge info event ${this.props.ev.getId()} has missing content. Tile will not render`);
|
||||
logger.warn(`Bridge info event ${this.props.ev.getId()} has missing content. Tile will not render`);
|
||||
return null;
|
||||
}
|
||||
if (!content.bridgebot) {
|
||||
// Bridgebot was not required previously, so in order to not break rooms we are allowing
|
||||
// the sender to be used in place. When the proposal is merged, this should be removed.
|
||||
console.warn(`Bridge info event ${this.props.ev.getId()} does not provide a 'bridgebot' key which`
|
||||
logger.warn(`Bridge info event ${this.props.ev.getId()} does not provide a 'bridgebot' key which`
|
||||
+ "is deprecated behaviour. Using sender for now.");
|
||||
content.bridgebot = this.props.ev.getSender();
|
||||
}
|
||||
|
|
|
@ -270,11 +270,11 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||
);
|
||||
} catch (e) {
|
||||
currentServerReachable = false;
|
||||
console.warn(
|
||||
logger.warn(
|
||||
`Unable to reach identity server at ${currentClientIdServer} to check ` +
|
||||
`for 3PIDs during IS change flow`,
|
||||
);
|
||||
console.warn(e);
|
||||
logger.warn(e);
|
||||
}
|
||||
const boundThreepids = threepids.filter(tp => tp.bound);
|
||||
let message;
|
||||
|
|
|
@ -168,11 +168,11 @@ export default class GeneralUserSettingsTab extends React.Component<IProps, ISta
|
|||
threepids = await getThreepidsWithBindStatus(cli);
|
||||
} catch (e) {
|
||||
const idServerUrl = MatrixClientPeg.get().getIdentityServerUrl();
|
||||
console.warn(
|
||||
logger.warn(
|
||||
`Unable to reach identity server at ${idServerUrl} to check ` +
|
||||
`for 3PIDs bindings in Settings`,
|
||||
);
|
||||
console.warn(e);
|
||||
logger.warn(e);
|
||||
}
|
||||
this.setState({
|
||||
emails: threepids.filter((a) => a.medium === 'email'),
|
||||
|
@ -218,11 +218,11 @@ export default class GeneralUserSettingsTab extends React.Component<IProps, ISta
|
|||
},
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn(
|
||||
logger.warn(
|
||||
`Unable to reach identity server at ${idServerUrl} to check ` +
|
||||
`for terms in Settings`,
|
||||
);
|
||||
console.warn(e);
|
||||
logger.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,8 @@ import CrossSigningPanel from "../../CrossSigningPanel";
|
|||
import EventIndexPanel from "../../EventIndexPanel";
|
||||
import InlineSpinner from "../../../elements/InlineSpinner";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
interface IIgnoredUserProps {
|
||||
userId: string;
|
||||
onUnignored: (userId: string) => void;
|
||||
|
@ -174,7 +176,7 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
|
|||
i--;
|
||||
} else {
|
||||
// Print out error with joining/leaving room
|
||||
console.warn(e);
|
||||
logger.warn(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue