1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Use the default hotbar as the hotbar for the default workspace

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-06-25 09:31:09 -04:00
parent 006f005184
commit c632c3db0d
2 changed files with 16 additions and 14 deletions

View File

@ -56,6 +56,18 @@ export default {
});
}
{
// grab the default named hotbar or the first.
const defaultHotbarIndex = Math.max(0, hotbars.findIndex(hotbar => hotbar.name === "default"));
const [{ name, id, items }] = hotbars.splice(defaultHotbarIndex, 1);
workspaceHotbars.set("default", {
name,
id,
items: items.filter(Boolean),
});
}
for (const cluster of clusters) {
const workspaceHotbar = workspaceHotbars.get(cluster.workspace);

View File

@ -23,8 +23,8 @@ import { computed, observable, reaction, makeObservable } from "mobx";
import { autoBind, iter, Singleton } from "./utils";
import { UserStore } from "../common/user-store";
import logger from "../main/logger";
import darkThemeBase from "./themes/lens-dark.json";
import lightThemeBase from "./themes/lens-light.json";
import darkTheme from "./themes/lens-dark.json";
import lightTheme from "./themes/lens-light.json";
export type ThemeId = string;
@ -41,16 +41,6 @@ export interface Theme {
author: string;
}
const darkTheme: Theme = {
...darkThemeBase,
type: darkThemeBase.type as ThemeType,
};
const lightTheme: Theme = {
...lightThemeBase,
type: lightThemeBase.type as ThemeType,
};
export interface ThemeItems extends Theme {
id: string;
}
@ -60,8 +50,8 @@ export class ThemeStore extends Singleton {
// bundled themes from `themes/${themeId}.json`
private allThemes = observable.map<string, Theme>([
["lens-dark", darkTheme],
["lens-light", lightTheme],
["lens-dark", { ...darkTheme, type: ThemeType.DARK }],
["lens-light", { ...lightTheme, type: ThemeType.LIGHT }],
]);
@computed get themes(): ThemeItems[] {