diff --git a/src/init.ts b/src/init.ts index 2285a990a3..9283e61de3 100644 --- a/src/init.ts +++ b/src/init.ts @@ -120,5 +120,6 @@ export const appInit = async (apiConfig?: ApiConfig, hostConfig?: HostConfig): P // apiConfig could have empty strings, meaning we have no valid connection. await store.dispatch('init', { apiConfig, hostConfig }) + return { apiConfig, hostConfig, apiConnected } } diff --git a/src/plugins/colorSet.ts b/src/plugins/colorSet.ts index aec098a9f8..724e137f92 100644 --- a/src/plugins/colorSet.ts +++ b/src/plugins/colorSet.ts @@ -75,12 +75,11 @@ export class ColorSet { */ reset (list: string, force = false): void { if (this.colorList[list] === undefined) return // not found - this.colorList[list].map(color => { - if (color.name && !force) { - // don't reset colors that have a name. - return color - } else { - return { ...color, used: false } + this.colorList[list].forEach(color => { + // don't reset colors that have a name, unless forced. + if (!color.name || force) { + color.used = false + delete color.name } }) } diff --git a/src/store/index.ts b/src/store/index.ts index bf7e2e836d..51c6579cb1 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -50,7 +50,7 @@ export default new Vuex.Store({ */ async reset ({ dispatch }, payload: string[]) { // Reset our color set. - Vue.$colorset.resetAll() + Vue.$colorset.forceResetAll() // Dispatch a reset for each registered module. const p: Promise[] = [] diff --git a/todo.md b/todo.md index 5b6ec62e7f..ee635caeaf 100644 --- a/todo.md +++ b/todo.md @@ -2,7 +2,6 @@ ## Next Up -- fix color swap when changing printers - add cpu time - clicking legend items when no chart throws error, fix. - sync instances across moonraker db