Skip to content

Commit 251d249

Browse files
committed
accountsReducer: Make REALM_ADD store feature level in Redux.
As we have included the feature level in REALM_ADD and Account type in the previous commits. Now, we store the feature level in Redux on REALM_ADD. Part of #4049.
1 parent 4519891 commit 251d249

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/account/__tests__/accountsReducer-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ describe('accountsReducer', () => {
3131
email: '',
3232
apiKey: '',
3333
realm: 'https://new.realm.org',
34-
zulipFeatureLevel: null, // Will be removed in an upcoming commit.
3534
});
3635

3736
const action = deepFreeze({

src/account/accountsReducer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const realmAdd = (state, action) => {
2121
if (accountIndex !== -1) {
2222
const newAccount = {
2323
...state[accountIndex],
24+
zulipFeatureLevel: action.zulipFeatureLevel,
2425
zulipVersion: action.zulipVersion,
2526
};
2627
return [newAccount, ...state.slice(0, accountIndex), ...state.slice(accountIndex + 1)];
@@ -32,7 +33,7 @@ const realmAdd = (state, action) => {
3233
apiKey: '',
3334
email: '',
3435
ackedPushToken: null,
35-
zulipFeatureLevel: null,
36+
zulipFeatureLevel: action.zulipFeatureLevel,
3637
zulipVersion: action.zulipVersion,
3738
},
3839
...state,

0 commit comments

Comments
 (0)