Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Don't show source picker if sources are 'managed'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Etchells authored and jopit committed Jun 19, 2020
1 parent 1639bf6 commit b61f0ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dev/src/command/connection/CreateUserProjectCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import InputUtil from "../../InputUtil";

const CREATE_PROJECT_WIZARD_NO_STEPS = 2;

const HAS_SELECTED_SOURCE_KEY = "first-create-done";
export const HAS_SELECTED_SOURCE_KEY = "first-create-done";

export default async function createProjectCmd(connection: Connection): Promise<void> {
if (!connection.isRemote) {
Expand Down
8 changes: 8 additions & 0 deletions dev/src/command/webview/SourcesPageWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import getManageSourcesPage from "./pages/SourcesPage";
import remoteConnectionOverviewCmd from "../connection/ConnectionOverviewCmd";
import { SourceEnablement, TemplateSource } from "../../codewind/Types";
import CWExtensionContext from "../../CWExtensionContext";
import { HAS_SELECTED_SOURCE_KEY } from "../connection/CreateUserProjectCmd";

export enum ManageSourcesWVMessages {
ENABLE_DISABLE = "enableOrDisable",
Expand All @@ -45,6 +46,13 @@ export class SourcesPageWrapper extends WebviewWrapper {
) {
super(getTitle(connection), ThemelessImages.Logo);
connection.onDidOpenSourcesPage(this);

const extState = CWExtensionContext.get().globalState;
const hasSelectedSource = extState.get(HAS_SELECTED_SOURCE_KEY) as boolean;
if (!hasSelectedSource) {
extState.update(HAS_SELECTED_SOURCE_KEY, true);
}

this.refresh();
}

Expand Down

0 comments on commit b61f0ba

Please sign in to comment.