@@ -293,7 +293,7 @@ function getDebugState(vms: ICellViewModel[]): DebugState {
293
293
return firstNonDesign ? firstNonDesign . runningByLine : DebugState . Design ;
294
294
}
295
295
296
- function createMiddleWare ( testMode : boolean ) : Redux . Middleware < { } , IStore > [ ] {
296
+ function createMiddleWare ( testMode : boolean , postOffice : PostOffice ) : Redux . Middleware < { } , IStore > [ ] {
297
297
// Create the middleware that modifies actions to queue new actions
298
298
const queueableActions = createQueueableActionMiddleware ( ) ;
299
299
@@ -304,8 +304,7 @@ function createMiddleWare(testMode: boolean): Redux.Middleware<{}, IStore>[] {
304
304
// Create the test middle ware. It sends messages that are used for testing only
305
305
// Or if testing in UI Test.
306
306
// tslint:disable-next-line: no-any
307
- const acquireVsCodeApi = ( window as any ) . acquireVsCodeApi as Function ;
308
- const isUITest = acquireVsCodeApi && acquireVsCodeApi ( ) . handleMessage ? true : false ;
307
+ const isUITest = postOffice . vscodeApi && ( postOffice . vscodeApi as any ) . handleMessage ? true : false ;
309
308
const testMiddleware = testMode || isUITest ? createTestMiddleware ( ) : undefined ;
310
309
311
310
// Create the logger if we're not in production mode or we're forcing logging
@@ -423,7 +422,7 @@ export function createStore<M>(
423
422
} ) ;
424
423
425
424
// Create our middleware
426
- const middleware = createMiddleWare ( testMode ) . concat ( [ addMessageDirectionMiddleware ] ) ;
425
+ const middleware = createMiddleWare ( testMode , postOffice ) . concat ( [ addMessageDirectionMiddleware ] ) ;
427
426
428
427
// Use this reducer and middle ware to create a store
429
428
const store = Redux . createStore ( rootReducer , Redux . applyMiddleware ( ...middleware ) ) ;
0 commit comments