Path: blob/main/components/dashboard/src/data/organizations/default-org-timeout-query.ts
2501 views
/**1* Copyright (c) 2025 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56import { WORKSPACE_TIMEOUT_DEFAULT_LONG, WORKSPACE_TIMEOUT_DEFAULT_SHORT } from "@gitpod/gitpod-protocol";7import { useOrgBillingMode } from "../billing-mode/org-billing-mode-query";89/**10* Returns the default workspace timeout for an organization based on their billing mode (does not take into account the organization's own settings)11*/12export const useDefaultOrgTimeoutQuery = () => {13const { data: billingMode } = useOrgBillingMode();1415const isPaidOrDedicated =16billingMode?.mode === "none" || (billingMode?.mode === "usage-based" && billingMode?.paid);1718return isPaidOrDedicated ? WORKSPACE_TIMEOUT_DEFAULT_LONG : WORKSPACE_TIMEOUT_DEFAULT_SHORT;19};202122