Skip to content

Commit

Permalink
make sure that we always have a default backend name when using pure …
Browse files Browse the repository at this point in the history
…structure
  • Loading branch information
undefined committed Apr 16, 2023
1 parent 9bcb65a commit 487c2d6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion source/class/cv/ui/structure/pure/Controller.js
Expand Up @@ -91,6 +91,12 @@ qx.Class.define('cv.ui.structure.pure.Controller', {
if (pagesElement.getAttribute('backend') !== null) {
settings.backend = pagesElement.getAttribute('backend');
defaultBackendName = settings.backend;
} else {
defaultBackendName = (
cv.Config.URL.backend ||
cv.Config.server.backend ||
'knxd'
).split(',')[0];
}
if (pagesElement.getAttribute('backend-url') !== null) {
settings.backendUrl = pagesElement.getAttribute('backend-url');
Expand Down Expand Up @@ -126,6 +132,11 @@ qx.Class.define('cv.ui.structure.pure.Controller', {
if (pagesElement.getAttribute('password') !== null) {
settings.credentials.password = pagesElement.getAttribute('password');
}

// make sure that the default name is the actual type
if (defaultBackendName === 'default') {
defaultBackendName = 'knxd';
}
if (defaultBackendName) {
cv.data.Model.getInstance().setDefaultBackendName(defaultBackendName);
}
Expand All @@ -138,7 +149,7 @@ qx.Class.define('cv.ui.structure.pure.Controller', {
for (const name in clients) {
client = clients[name];
client.login(true, cv.Config.configSettings.credentials, () => {
this.debug('logged in');
this.debug(name + ' logged in');
cv.io.BackendConnections.startInitialRequest(name);
});
}
Expand Down

0 comments on commit 487c2d6

Please sign in to comment.