db config fix

This commit is contained in:
Jan Prochazka
2021-12-05 17:21:40 +01:00
parent 46ab02f914
commit f690446cee
2 changed files with 10 additions and 16 deletions

View File

@@ -15,13 +15,9 @@ export function getConnectionColor(
const current = connections.find(x => x._id == dbid.conid);
const { database } = dbid;
let colorName = useConnectionFallback || !database ? current?.connectionColor : null;
if (
database &&
current.databaseConfig &&
current.databaseConfig[database] &&
current.databaseConfig[database].databaseColor
) {
colorName = current.databaseConfig[database].databaseColor;
const dbConfig = (current?.databases || []).find(x => x.name == database);
if (dbConfig?.databaseColor) {
colorName = dbConfig.databaseColor;
}
if (!colorName) return undefined;
const palettes = themeType == 'dark' ? presetDarkPalettes : presetPalettes;