Skip to content

Commit

Permalink
ips-nmos-api: fix compiling
Browse files Browse the repository at this point in the history
- 'import' can't be used outside of a module.
- Fix syntax.
- I don't get why `window` would be defined in a server app...
  • Loading branch information
pkeroulas committed Mar 15, 2022
1 parent 8af43a7 commit 4140f7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ips-nmos-api/src/http/route-bulk.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
var axios = require('axios')
var constants = require('./constants')

export default (nmos, bulkStuff, fallback) => {
module.export = function (nmos, bulkStuff, fallback) {
var device = null
return nmos.devices(bulkStuff.deviceID)
.then((passedDevice) => {
Expand Down
4 changes: 2 additions & 2 deletions src/ips-nmos-api/src/http/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

var axios = require('axios')
var constants = require('./constants')
import routeBulk from './route-bulk'
import AddToken from './subscription/add-token'
var routeBulk = require('./route-bulk')
var AddToken = require('./subscription/add-token')

let addToken = AddToken()

Expand Down
2 changes: 1 addition & 1 deletion src/ips-nmos-api/src/http/subscription/add-token.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = () => {
const TOKEN_KEY = 'accessToken'
if (!window.sessionStorage) {
if (typeof window !== 'undefined' && !window.sessionStorage) {
console.error('Please use a browser that supports Session Storage')
return
}
Expand Down

0 comments on commit 4140f7b

Please sign in to comment.