mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Refactor Global state into Context Files (#128)
This commit is contained in:
@@ -5,8 +5,6 @@ import * as ko from "knockout";
|
||||
import * as React from "react";
|
||||
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
|
||||
import * as ViewModels from "../../Contracts/ViewModels";
|
||||
import { CosmosClient } from "../../Common/CosmosClient";
|
||||
|
||||
import NewContainerIcon from "../../../images/Hero-new-container.svg";
|
||||
import NewNotebookIcon from "../../../images/Hero-new-notebook.svg";
|
||||
import NewQueryIcon from "../../../images/AddSqlQuery_16x16.svg";
|
||||
@@ -19,6 +17,7 @@ import AddDatabaseIcon from "../../../images/AddDatabase.svg";
|
||||
import SampleIcon from "../../../images/Hero-sample.svg";
|
||||
import { DataSamplesUtil } from "../DataSamples/DataSamplesUtil";
|
||||
import Explorer from "../Explorer";
|
||||
import { userContext } from "../../UserContext";
|
||||
|
||||
/**
|
||||
* TODO Remove this when fully ported to ReactJS
|
||||
@@ -46,7 +45,7 @@ export class SplashScreenComponentAdapter implements ReactAdapter {
|
||||
};
|
||||
|
||||
private clearMostRecent = (): void => {
|
||||
this.container.mostRecentActivity.clear(CosmosClient.databaseAccount().id);
|
||||
this.container.mostRecentActivity.clear(userContext.databaseAccount?.id);
|
||||
this.forceRender();
|
||||
};
|
||||
|
||||
@@ -195,7 +194,7 @@ export class SplashScreenComponentAdapter implements ReactAdapter {
|
||||
}
|
||||
|
||||
private createRecentItems(): SplashScreenItem[] {
|
||||
return this.container.mostRecentActivity.getItems(CosmosClient.databaseAccount().id).map(item => ({
|
||||
return this.container.mostRecentActivity.getItems(userContext.databaseAccount?.id).map(item => ({
|
||||
iconSrc: MostRecentActivity.MostRecentActivity.getItemIcon(item),
|
||||
title: item.title,
|
||||
description: item.description,
|
||||
|
||||
Reference in New Issue
Block a user