0
0
mirror of https://github.com/OpenBazaar/openbazaar-desktop synced 2025-10-06 00:22:47 +02:00
Files
openbazaar-desktop/js/app.js

18 lines
540 B
JavaScript

// Object where we can (very judiciously) attach any app-wide
// shared state (e.g. router)
export default {
serverConfig: {},
// Short-hand convenience method to get the HTTP url of the active server configuration
getServerUrl(urlFrag = '') {
if (!this.serverConfigs) {
throw new Error('I\'m expecting a ServerConfigs collection instance to have' +
' been attached to this instance.');
}
return this.serverConfigs.activeServer ?
`${this.serverConfigs.activeServer.httpUrl}${urlFrag}` : '';
},
};