Skip to content

Commit

Permalink
Merge pull request #1496 from AdaptiveConsulting/ARTP-1013_finsemble_fix
Browse files Browse the repository at this point in the history
fix(finsemble): conditionally load openfinFDC3 (ARTP-1013)
  • Loading branch information
rikoe authored Mar 13, 2020
2 parents c7b128b + af9c679 commit a177c23
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/client/src/rt-interop/util/getProvider.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { OpenFinFDC3, FDC3 } from '../fdc3'

const isOpenFin = 'fin' in window
const isFinsemble = 'FSBL' in window
// TODO: We should not need to negate `isFinsemble` to check for OpenFin.
// Somewhere, `fin` is being added to the `window` object even in electron/finsemble versions.
const isOpenFin = 'fin' in window && !isFinsemble

export const getProvider = () => {
if (isOpenFin) {
// @ts-ignore
const { OpenFinFDC3, FDC3 } = require('../fdc3')
const openFinFDC3 = new OpenFinFDC3()

return new FDC3(openFinFDC3)
}

Expand Down

0 comments on commit a177c23

Please sign in to comment.