mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-06 17:02:54 +02:00
Fix for mode switch
This commit is contained in:
@@ -9,6 +9,8 @@ export const CONTEXT = {
|
||||
backer: "frontMatter:backers:supporter",
|
||||
isValidFile: "frontMatter:file:isValid",
|
||||
|
||||
hasViewModes: "frontMatter:has:modes",
|
||||
|
||||
isSnippetsDashboardEnabled: "frontMatter:dashboard:snippets:enabled",
|
||||
isDataDashboardEnabled: "frontMatter:dashboard:data:enabled",
|
||||
};
|
||||
@@ -2,7 +2,7 @@ import { ModeListener } from './../listeners/general/ModeListener';
|
||||
import { SETTING_GLOBAL_ACTIVE_MODE, SETTING_GLOBAL_MODES } from './../constants/settings';
|
||||
import { commands, StatusBarAlignment, StatusBarItem, ThemeColor, window } from "vscode";
|
||||
import { Settings } from "../helpers/SettingsHelper";
|
||||
import { COMMAND_NAME } from '../constants';
|
||||
import { COMMAND_NAME, CONTEXT } from '../constants';
|
||||
import { Mode } from '../models';
|
||||
|
||||
|
||||
@@ -36,9 +36,11 @@ export class ModeSwitch {
|
||||
const modes = Settings.get<string | null>(SETTING_GLOBAL_MODES);
|
||||
if (!modes || modes.length === 0) {
|
||||
ModeSwitch.statusBarElm.hide();
|
||||
commands.executeCommand('setContext', CONTEXT.hasViewModes, false);
|
||||
return;
|
||||
}
|
||||
|
||||
commands.executeCommand('setContext', CONTEXT.hasViewModes, true);
|
||||
ModeSwitch.setText();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user