@@ -25,13 +25,8 @@ import type { ThunkArgs } from "./types";
2525
2626export function setSourceMetaData ( sourceId : SourceId ) {
2727 return async ( { dispatch, getState } : ThunkArgs ) => {
28- const sourceRecord = getSource ( getState ( ) , sourceId ) ;
29- if ( ! sourceRecord ) {
30- return ;
31- }
32-
33- const source = sourceRecord . toJS ( ) ;
34- if ( ! source . text || source . isWasm ) {
28+ const source = getSource ( getState ( ) , sourceId ) ;
29+ if ( ! source || ! source . text || source . isWasm ) {
3530 return ;
3631 }
3732
@@ -48,19 +43,19 @@ export function setSourceMetaData(sourceId: SourceId) {
4843
4944export function setSymbols ( sourceId : SourceId ) {
5045 return async ( { dispatch, getState } : ThunkArgs ) => {
51- const sourceRecord = getSource ( getState ( ) , sourceId ) ;
52- if ( ! sourceRecord ) {
53- return ;
54- }
55-
56- const source = sourceRecord . toJS ( ) ;
57- if ( ! source . text || source . isWasm || hasSymbols ( getState ( ) , source ) ) {
46+ const source = getSource ( getState ( ) , sourceId ) ;
47+ if (
48+ ! source ||
49+ ! source . text ||
50+ source . isWasm ||
51+ hasSymbols ( getState ( ) , source )
52+ ) {
5853 return ;
5954 }
6055
6156 await dispatch ( {
6257 type : "SET_SYMBOLS" ,
63- source,
58+ source : source . toJS ( ) ,
6459 [ PROMISE ] : getSymbols ( source . id )
6560 } ) ;
6661
@@ -94,22 +89,17 @@ export function setOutOfScopeLocations() {
9489
9590export function setPausePoints ( sourceId : SourceId ) {
9691 return async ( { dispatch, getState, client } : ThunkArgs ) => {
97- const sourceRecord = getSource ( getState ( ) , sourceId ) ;
98- if ( ! sourceRecord ) {
99- return ;
100- }
101-
102- const source = sourceRecord . toJS ( ) ;
103- if ( ! source . text || source . isWasm ) {
92+ const source = getSource ( getState ( ) , sourceId ) ;
93+ if ( ! source || ! source . text || source . isWasm ) {
10494 return ;
10595 }
10696
10797 const pausePoints = await getPausePoints ( source . id ) ;
108- await client . setPausePoints ( sourceId , pausePoints ) ;
98+ await client . setPausePoints ( source . id , pausePoints ) ;
10999
110100 dispatch ( {
111101 type : "SET_PAUSE_POINTS" ,
112- source,
102+ source : source . toJS ( ) ,
113103 pausePoints
114104 } ) ;
115105 } ;
0 commit comments