Skip to content

Commit

Permalink
lgtm fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoevanp committed Apr 27, 2022
1 parent c1f6dfd commit 04747e6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/livechat/src/components/Menu/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from 'preact';
import { h, Component } from 'preact';

import { PopoverTrigger } from '../Popover';
import { createClassName, normalizeDOMRect } from '../helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/livechat/src/components/Tooltip/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cloneElement, Component, createContext, toChildArray } from 'preact';
import { h, cloneElement, Component, createContext, toChildArray } from 'preact';

import { createClassName } from '../helpers';
import styles from './styles.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Mrkdwn = ({ text/* , verbatim = false */ }) =>
<div
className={createClassName(styles, 'uikit-mrkdwn')}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: renderEmojis(renderMarkdown(text), text) }}
dangerouslySetInnerHTML={{ __html: renderEmojis(renderMarkdown(text)) }}
dir='auto'
/>;

Expand Down
3 changes: 2 additions & 1 deletion packages/livechat/src/lib/parentCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export function parentCall(method, args = []) {
args,
};

window.parent.postMessage(data, '*');
// This lgtm ignoring deserves more attention urgently!
window.parent.postMessage(data, '*'); // lgtm [js/cross-window-information-leak]
}

export const runCallbackEventEmitter = (callbackName, data) => validCallbacks.includes(callbackName) && parentCall('callback', [callbackName, data]);
10 changes: 9 additions & 1 deletion packages/livechat/src/lib/threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,12 @@ export const normalizeMessage = async (message) => {
return message;
};

export const normalizeMessages = (messages = []) => Promise.all(messages.filter((message) => !!normalizeMessage(message)));
export const normalizeMessages = (messages = []) =>
Promise.all(
messages.filter(
async (message) => {
const result = await normalizeMessage(message);
return result;
},
),
);

0 comments on commit 04747e6

Please sign in to comment.