Introduce isStagingServer util method

This commit is contained in:
Fedor Indutny
2024-09-04 11:12:45 -07:00
committed by GitHub
parent 4cdb6fab08
commit cd44a7a033
24 changed files with 80 additions and 71 deletions

View File

@@ -0,0 +1,17 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { Environment, getEnvironment } from '../environment';
import { isStaging } from './version';
export function isStagingServer(
serverUrl = window.SignalContext.config.serverUrl
): boolean {
if (getEnvironment() === Environment.Staging) {
return true;
}
if (isStaging(window.getVersion())) {
return true;
}
return /staging/i.test(serverUrl);
}