fix: keep Alta bearer out of proxy command lines
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
'use strict';
|
||||
|
||||
(function exposeRendererController(globalScope) {
|
||||
function createRendererController({
|
||||
disconnect,
|
||||
renderConnectionState,
|
||||
clearDisconnectedState,
|
||||
showConnectionStatus,
|
||||
} = {}) {
|
||||
if (
|
||||
typeof disconnect !== 'function' ||
|
||||
typeof renderConnectionState !== 'function' ||
|
||||
typeof clearDisconnectedState !== 'function' ||
|
||||
typeof showConnectionStatus !== 'function'
|
||||
) {
|
||||
throw new TypeError('Renderer controller dependencies are invalid.');
|
||||
}
|
||||
|
||||
return Object.freeze({
|
||||
async disconnect() {
|
||||
const result = await disconnect();
|
||||
if (!result || result.success !== true) {
|
||||
const message = result && typeof result.message === 'string'
|
||||
? result.message
|
||||
: 'Failed to disconnect from Alta. The current connection remains active.';
|
||||
showConnectionStatus(message, 'error');
|
||||
return result;
|
||||
}
|
||||
|
||||
renderConnectionState(result);
|
||||
clearDisconnectedState();
|
||||
showConnectionStatus('Disconnected from Alta.', 'info');
|
||||
return result;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const api = Object.freeze({ createRendererController });
|
||||
if (typeof module !== 'undefined' && module.exports) module.exports = api;
|
||||
if (globalScope) globalScope.AptRendererController = api;
|
||||
}(typeof window !== 'undefined' ? window : undefined));
|
||||
Reference in New Issue
Block a user