Cleanup RemoteConfig

This commit is contained in:
Fedor Indutny 2023-12-08 00:59:54 +01:00 committed by GitHub
parent 7bad05f5a0
commit b2a3605d77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 121 additions and 614 deletions

View file

@ -1,34 +1,7 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { isBucketValueEnabled, isEnabled } from '../RemoteConfig';
import { isBeta } from './version';
// Note: selectors/items is the other place this check is done
export const getStoriesAvailable = (): boolean => {
if (
isBucketValueEnabled(
'desktop.stories2',
window.textsecure.storage.user.getNumber(),
window.textsecure.storage.user.getAci()
)
) {
return true;
}
if (isEnabled('desktop.internalUser')) {
return true;
}
if (isEnabled('desktop.stories2.beta') && isBeta(window.getVersion())) {
return true;
}
return false;
};
export const getStoriesDisabled = (): boolean =>
window.Events.getHasStoriesDisabled();
export const getStoriesBlocked = (): boolean =>
!getStoriesAvailable() || getStoriesDisabled();
export const getStoriesBlocked = (): boolean => getStoriesDisabled();