diff --git a/src/components/workspace/WorkspacesLayout.tsx b/src/components/workspace/WorkspacesLayout.tsx index 2a0685495..86bcccb0d 100644 --- a/src/components/workspace/WorkspacesLayout.tsx +++ b/src/components/workspace/WorkspacesLayout.tsx @@ -106,9 +106,11 @@ const WorkspacesLayout = () => { tabList={tabListInjectedProps => ( <> {renderTabs(tabListInjectedProps)} -
- + -
+ {!workspacesStore.isFull && ( + + )} )} tabPanels={workspacesStore.workspaces.map(workspace => ( diff --git a/src/stores/RootStore.ts b/src/stores/RootStore.ts index 8c41eae0d..b803e6863 100644 --- a/src/stores/RootStore.ts +++ b/src/stores/RootStore.ts @@ -14,7 +14,6 @@ * limitations under the License. ***************************************************************************** */ -import { action, computed } from 'mobx'; import { nanoid } from 'nanoid'; import ApiSchema from '../api/ApiSchema'; import WorkspacesStore, { WorkspacesUrlState } from './workspace/WorkspacesStore'; @@ -56,11 +55,6 @@ export default class RootStore { window.history.replaceState({}, '', window.location.pathname); } - @computed - public get isBookmarksFull(): boolean { - return this.workspacesStore.selectedStore.bookmarksStore.isBookmarksFull; - } - private parseUrlState = (): WorkspacesUrlState | null => { try { if (window.location.search.split('&').length > 1) { @@ -121,7 +115,6 @@ export default class RootStore { } }; - @action public handleQuotaExceededError = async (unsavedData?: DbData) => { const errorId = nanoid(); this.notificationsStore.addMessage({ @@ -137,7 +130,7 @@ export default class RootStore { }); }; - public clearAppData = async (errorId: string, unsavedData?: DbData) => { + private clearAppData = async (errorId: string, unsavedData?: DbData) => { this.notificationsStore.deleteMessage(errorId); try { await this.api.indexedDb.clearAllData(); diff --git a/src/stores/workspace/WorkspacesStore.ts b/src/stores/workspace/WorkspacesStore.ts index e4b1ab4de..0fc0f405c 100644 --- a/src/stores/workspace/WorkspacesStore.ts +++ b/src/stores/workspace/WorkspacesStore.ts @@ -26,7 +26,7 @@ import FiltersHistoryStore from '../FiltersHistoryStore'; export type WorkspacesUrlState = Array; export default class WorkspacesStore { - public readonly MAX_WORKSPACES_COUNT = 12; + public readonly MAX_WORKSPACES_COUNT = 10; public selectedStore = new SelectedStore(this, this.api.indexedDb); @@ -48,10 +48,6 @@ export default class WorkspacesStore { @observable workspaces: Array = []; - @computed get eventStores() { - return this.workspaces.map(workspace => workspace.eventsStore); - } - @computed get isFull() { return this.workspaces.length === this.MAX_WORKSPACES_COUNT; } @@ -82,6 +78,7 @@ export default class WorkspacesStore { @action public addWorkspace = (workspace: WorkspaceStore) => { + if (this.isFull) return; this.workspaces.push(workspace); this.tabsStore.setActiveWorkspace(this.workspaces.length - 1); }; diff --git a/src/styles/workspace.scss b/src/styles/workspace.scss index 9399d59a4..8d29a9eef 100644 --- a/src/styles/workspace.scss +++ b/src/styles/workspace.scss @@ -55,6 +55,7 @@ &__add { background-color: #dee5ed; + border: none; text-align: center; padding: 7px; color: $workspaceTabActiveBackground;