Rev stories feature flag
This commit is contained in:
parent
d0fb25f758
commit
9229fca569
4 changed files with 10 additions and 10 deletions
|
@ -32,8 +32,8 @@ export type ConfigKeyType =
|
||||||
| 'desktop.sendSenderKey3'
|
| 'desktop.sendSenderKey3'
|
||||||
| 'desktop.showUserBadges.beta'
|
| 'desktop.showUserBadges.beta'
|
||||||
| 'desktop.showUserBadges2'
|
| 'desktop.showUserBadges2'
|
||||||
| 'desktop.stories'
|
| 'desktop.stories2'
|
||||||
| 'desktop.stories.beta'
|
| 'desktop.stories2.beta'
|
||||||
| 'desktop.usernames'
|
| 'desktop.usernames'
|
||||||
| 'global.attachments.maxBytes'
|
| 'global.attachments.maxBytes'
|
||||||
| 'global.calling.maxGroupCallRingSize'
|
| 'global.calling.maxGroupCallRingSize'
|
||||||
|
|
|
@ -94,7 +94,7 @@ export const getStoriesEnabled = createSelector(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isRemoteConfigBucketEnabled(remoteConfig, 'desktop.stories', e164, aci)
|
isRemoteConfigBucketEnabled(remoteConfig, 'desktop.stories2', e164, aci)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ export const getStoriesEnabled = createSelector(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isRemoteConfigFlagEnabled(remoteConfig, 'desktop.stories.beta') &&
|
isRemoteConfigFlagEnabled(remoteConfig, 'desktop.stories2.beta') &&
|
||||||
isBeta(window.getVersion())
|
isBeta(window.getVersion())
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -13,12 +13,12 @@ describe('RemoteConfig', () => {
|
||||||
const uuid = '15b9729c-51ea-4ddb-b516-652befe78062';
|
const uuid = '15b9729c-51ea-4ddb-b516-652befe78062';
|
||||||
|
|
||||||
describe('#innerIsBucketValueEnabled', () => {
|
describe('#innerIsBucketValueEnabled', () => {
|
||||||
// Note: bucketValue is 497941 for 'desktop.stories' key
|
// Note: bucketValue is 497941 for 'desktop.stories2' key
|
||||||
|
|
||||||
it('returns true for 100% wildcard', () => {
|
it('returns true for 100% wildcard', () => {
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
innerIsBucketValueEnabled(
|
innerIsBucketValueEnabled(
|
||||||
'desktop.stories',
|
'desktop.stories2',
|
||||||
'*:1000000',
|
'*:1000000',
|
||||||
'+12125550000',
|
'+12125550000',
|
||||||
uuid
|
uuid
|
||||||
|
@ -30,7 +30,7 @@ describe('RemoteConfig', () => {
|
||||||
it('returns true for 50% on country code 1', () => {
|
it('returns true for 50% on country code 1', () => {
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
innerIsBucketValueEnabled(
|
innerIsBucketValueEnabled(
|
||||||
'desktop.stories',
|
'desktop.stories2',
|
||||||
'1:500000',
|
'1:500000',
|
||||||
'+12125550000',
|
'+12125550000',
|
||||||
uuid
|
uuid
|
||||||
|
@ -42,7 +42,7 @@ describe('RemoteConfig', () => {
|
||||||
it('returns false for 40% on country code 1', () => {
|
it('returns false for 40% on country code 1', () => {
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
innerIsBucketValueEnabled(
|
innerIsBucketValueEnabled(
|
||||||
'desktop.stories',
|
'desktop.stories2',
|
||||||
'1:400000',
|
'1:400000',
|
||||||
'+12125550000',
|
'+12125550000',
|
||||||
uuid
|
uuid
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { isBeta } from './version';
|
||||||
export const getStoriesAvailable = (): boolean => {
|
export const getStoriesAvailable = (): boolean => {
|
||||||
if (
|
if (
|
||||||
isBucketValueEnabled(
|
isBucketValueEnabled(
|
||||||
'desktop.stories',
|
'desktop.stories2',
|
||||||
window.textsecure.storage.user.getNumber(),
|
window.textsecure.storage.user.getNumber(),
|
||||||
window.textsecure.storage.user.getUuid(UUIDKind.ACI)?.toString()
|
window.textsecure.storage.user.getUuid(UUIDKind.ACI)?.toString()
|
||||||
)
|
)
|
||||||
|
@ -21,7 +21,7 @@ export const getStoriesAvailable = (): boolean => {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEnabled('desktop.stories.beta') && isBeta(window.getVersion())) {
|
if (isEnabled('desktop.stories2.beta') && isBeta(window.getVersion())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue