@uppy/companion-client
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -53,4 +53,6 @@ 'use strict'; | ||
response = _RequestClient.prototype.onReceiveResponse.call(this, response); | ||
var authenticated = response.status !== 401; | ||
this.uppy.getPlugin(this.pluginId).setPluginState({ | ||
var plugin = this.uppy.getPlugin(this.pluginId); | ||
var oldAuthenticated = plugin.getPluginState().authenticated; | ||
var authenticated = oldAuthenticated ? response.status !== 401 : response.status < 400; | ||
plugin.setPluginState({ | ||
authenticated: authenticated | ||
@@ -57,0 +59,0 @@ }); |
@@ -209,3 +209,3 @@ 'use strict'; | ||
return { | ||
'Accept': 'application/json', | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json', | ||
@@ -218,2 +218,2 @@ 'Uppy-Versions': "@uppy/companion-client=" + RequestClient.VERSION | ||
return RequestClient; | ||
}(), _class.VERSION = "1.2.0", _temp); | ||
}(), _class.VERSION = "1.3.0", _temp); |
{ | ||
"name": "@uppy/companion-client", | ||
"description": "Client library for communication with Companion. Intended for use in Uppy plugins.", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "bd2beedcffbaa840de7069860e341f02268ddbb1" | ||
"gitHead": "056a7114a15fc7480a4014342d7f2c19305dc96c" | ||
} |
@@ -33,4 +33,6 @@ 'use strict' | ||
response = super.onReceiveResponse(response) | ||
const authenticated = response.status !== 401 | ||
this.uppy.getPlugin(this.pluginId).setPluginState({ authenticated }) | ||
const plugin = this.uppy.getPlugin(this.pluginId) | ||
const oldAuthenticated = plugin.getPluginState().authenticated | ||
const authenticated = oldAuthenticated ? response.status !== 401 : response.status < 400 | ||
plugin.setPluginState({ authenticated }) | ||
return response | ||
@@ -37,0 +39,0 @@ } |
@@ -29,3 +29,3 @@ 'use strict' | ||
return { | ||
'Accept': 'application/json', | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json', | ||
@@ -32,0 +32,0 @@ 'Uppy-Versions': `@uppy/companion-client=${RequestClient.VERSION}` |
@@ -17,11 +17,15 @@ const UppySocket = require('./Socket') | ||
} | ||
close (args) { | ||
webSocketCloseSpy(args) | ||
} | ||
send (json) { | ||
webSocketSendSpy(json) | ||
} | ||
triggerOpen () { | ||
this.onopen() | ||
} | ||
triggerClose () { | ||
@@ -28,0 +32,0 @@ this.onclose() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38820
938