diff --git a/src/Explorer/Controls/Settings/SettingsComponent.tsx b/src/Explorer/Controls/Settings/SettingsComponent.tsx index 132622e9f..7f4f8c64b 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.tsx @@ -213,7 +213,8 @@ export class SettingsComponent extends React.Component = ({ totalThroughput *= numberOfRegions; setTotalThroughputUsed(totalThroughput); - if (throughputCap && throughputCap - totalThroughput < throughput) { + if (throughputCap && throughputCap !== -1 && throughputCap - totalThroughput < throughput) { setThroughputError( `Your account is currently configured with a total throughput limit of ${throughputCap} RU/s. This update isn't possible because it would increase the total throughput to ${ totalThroughput + throughput * numberOfRegions @@ -73,7 +73,7 @@ export const ThroughputInput: FunctionComponent = ({ }, []); const checkThroughputCap = (newThroughput: number): boolean => { - if (throughputCap && throughputCap - totalThroughputUsed < newThroughput) { + if (throughputCap && throughputCap !== -1 && throughputCap - totalThroughputUsed < newThroughput) { setThroughputError( `Your account is currently configured with a total throughput limit of ${throughputCap} RU/s. This update isn't possible because it would increase the total throughput to ${ totalThroughputUsed + newThroughput * numberOfRegions diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index f100d7b7a..9ea267ef9 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -1176,7 +1176,8 @@ export default class Explorer { ); } else { - userContext.databaseAccount?.properties.capacity?.totalThroughputLimit + const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit; + throughputCap && throughputCap !== -1 ? await useDatabases.getState().loadAllOffers() : await useDatabases.getState().loadDatabaseOffers(); useSidePanel diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx index 3a2495362..4507d51a8 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx @@ -311,7 +311,8 @@ function createNewDatabase(container: Explorer): CommandButtonComponentProps { iconSrc: AddDatabaseIcon, iconAlt: label, onCommandClick: async () => { - if (userContext.databaseAccount?.properties.capacity?.totalThroughputLimit) { + const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit; + if (throughputCap && throughputCap !== -1) { await useDatabases.getState().loadAllOffers(); } useSidePanel.getState().openSidePanel("New " + getDatabaseName(), ); diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 10866cf6f..d6afda063 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -308,7 +308,8 @@ export class SplashScreen extends React.Component { title: "New " + getDatabaseName(), description: undefined, onClick: async () => { - if (userContext.databaseAccount?.properties.capacity?.totalThroughputLimit) { + const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit; + if (throughputCap && throughputCap !== -1) { await useDatabases.getState().loadAllOffers(); } useSidePanel diff --git a/src/Explorer/Tree/Collection.ts b/src/Explorer/Tree/Collection.ts index 5f836f7fb..58c06f521 100644 --- a/src/Explorer/Tree/Collection.ts +++ b/src/Explorer/Tree/Collection.ts @@ -576,9 +576,8 @@ export default class Collection implements ViewModels.Collection { public onSettingsClick = async (): Promise => { useSelectedNode.getState().setSelectedNode(this); - userContext.databaseAccount?.properties.capacity?.totalThroughputLimit - ? await useDatabases.getState().loadAllOffers() - : await this.loadOffer(); + const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit; + throughputCap && throughputCap !== -1 ? await useDatabases.getState().loadAllOffers() : await this.loadOffer(); this.selectedSubnodeKind(ViewModels.CollectionTabKind.Settings); TelemetryProcessor.trace(Action.SelectItem, ActionModifiers.Mark, { description: "Settings node", diff --git a/src/Explorer/Tree/Database.tsx b/src/Explorer/Tree/Database.tsx index 0ea1130fb..156b5f275 100644 --- a/src/Explorer/Tree/Database.tsx +++ b/src/Explorer/Tree/Database.tsx @@ -66,7 +66,8 @@ export default class Database implements ViewModels.Database { dataExplorerArea: Constants.Areas.ResourceTree, }); - if (userContext.databaseAccount?.properties.capacity?.totalThroughputLimit) { + const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit; + if (throughputCap && throughputCap !== -1) { await useDatabases.getState().loadAllOffers(); }