mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 09:51:11 +00:00
Remove window.dataExplorerPlatform (#279)
More cleanup for #253 - Remove window.dataExplorerPlatform - Remove explorer factories
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { configContext, Platform } from "../ConfigContext";
|
||||
import * as ViewModels from "../Contracts/ViewModels";
|
||||
import { PlatformType } from "../PlatformType";
|
||||
import { PortalTokenProvider } from "./PortalTokenProvider";
|
||||
|
||||
export class TokenProviderFactory {
|
||||
private constructor() {}
|
||||
|
||||
public static create(): ViewModels.TokenProvider {
|
||||
const platformType = window.dataExplorerPlatform;
|
||||
const platformType = configContext.platform;
|
||||
switch (platformType) {
|
||||
case PlatformType.Portal:
|
||||
case PlatformType.Hosted:
|
||||
case Platform.Portal:
|
||||
case Platform.Hosted:
|
||||
return new PortalTokenProvider();
|
||||
case PlatformType.Emulator:
|
||||
case Platform.Emulator:
|
||||
default:
|
||||
// should never get into this state
|
||||
throw new Error(`Unknown platform ${platformType}`);
|
||||
|
||||
Reference in New Issue
Block a user