mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Introduce isStagingServer util method
This commit is contained in:
17
ts/util/isStagingServer.ts
Normal file
17
ts/util/isStagingServer.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user