Bug 1580839 - Evaluate debugger expressions after connecting with the target, r=jlast.

Differential Revision: https://phabricator.services.mozilla.com/D50639

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Hackett 2019-10-26 11:58:57 +00:00
Родитель e35cbe03a4
Коммит 642472368d
3 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -8,9 +8,10 @@ import { clearDocuments } from "../utils/editor";
import sourceQueue from "../utils/source-queue";
import { updateThreads } from "./threads";
import { evaluateExpressions } from "./expressions";
import { clearWasmStates } from "../utils/wasm";
import { getMainThread } from "../selectors";
import { getMainThread, getThreadContext } from "../selectors";
import type { Action, ThunkArgs } from "./types";
/**
@ -51,9 +52,9 @@ export function connect(
traits: Object,
isWebExtension: boolean
) {
return async function({ dispatch }: ThunkArgs) {
return async function({ dispatch, getState }: ThunkArgs) {
await dispatch(updateThreads());
dispatch(
await dispatch(
({
type: "CONNECT",
mainThread: {
@ -66,6 +67,9 @@ export function connect(
isWebExtension,
}: Action)
);
const cx = getThreadContext(getState());
dispatch(evaluateExpressions(cx));
};
}

Просмотреть файл

@ -37,6 +37,7 @@ describe("navigation", () => {
const { dispatch, getState } = createStore({
fetchThreads: async () => [],
getMainThread: () => "FakeThread",
evaluateExpressions: () => {},
});
await dispatch(
actions.connect("http://test.com/foo", "actor", false, false)

Просмотреть файл

@ -53,7 +53,6 @@ type Props = {
clearAutocomplete: typeof actions.clearAutocomplete,
addExpression: typeof actions.addExpression,
clearExpressionError: typeof actions.clearExpressionError,
evaluateExpressions: typeof actions.evaluateExpressions,
updateExpression: typeof actions.updateExpression,
deleteExpression: typeof actions.deleteExpression,
openLink: typeof actions.openLink,
@ -81,11 +80,7 @@ class Expressions extends Component<Props, State> {
}
componentDidMount() {
const { cx, expressions, evaluateExpressions, showInput } = this.props;
if (expressions.length > 0) {
evaluateExpressions(cx);
}
const { showInput } = this.props;
// Ensures that the input is focused when the "+"
// is clicked while the panel is collapsed
@ -404,7 +399,6 @@ export default connect<Props, OwnProps, _, _, _, _>(
clearAutocomplete: actions.clearAutocomplete,
addExpression: actions.addExpression,
clearExpressionError: actions.clearExpressionError,
evaluateExpressions: actions.evaluateExpressions,
updateExpression: actions.updateExpression,
deleteExpression: actions.deleteExpression,
openLink: actions.openLink,