Skip to content

Commit

Permalink
[native] introduce addKeyserverActionType
Browse files Browse the repository at this point in the history
Summary:
This diff introduces the `ADD_KEYSERVER` redux action type as well as the `AddKeyserverPayload` type that we will need for this redux action. Since at this moment we are only adding and persisting any newly added keyserver to the keyserver redux store, we don't need start, success, fail action types since we are not making any calls to an endpoint

Linear task: https://linear.app/comm/issue/ENG-5339/introduce-addkeyserveractiontype

Depends on D9590

Test Plan: `flow`

Reviewers: inka, michal, rohan

Reviewed By: michal

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9591
  • Loading branch information
ginsueddy committed Nov 1, 2023
1 parent 50808c7 commit 07c3986
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/actions/keyserver-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// @flow

const addKeyserverActionType = 'ADD_KEYSERVER';

export { addKeyserverActionType };
5 changes: 5 additions & 0 deletions lib/types/keyserver-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export type SelectedKeyserverInfo = {
+keyserverInfo: KeyserverInfo,
};

export type AddKeyserverPayload = {
+keyserverAdminUserID: string,
+newKeyserverInfo: KeyserverInfo,
};

export const keyserverInfoValidator: TInterface<KeyserverInfo> =
tShape<KeyserverInfo>({
cookie: t.maybe(t.String),
Expand Down
6 changes: 5 additions & 1 deletion lib/types/redux-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import type {
SetCalendarDeletedFilterPayload,
} from './filter-types.js';
import type { IntegrityStore } from './integrity-types.js';
import type { KeyserverStore } from './keyserver-types.js';
import type { KeyserverStore, AddKeyserverPayload } from './keyserver-types.js';
import type { LifecycleState } from './lifecycle-state-types.js';
import type {
FetchInviteLinksResponse,
Expand Down Expand Up @@ -1229,6 +1229,10 @@ export type BaseAction =
| {
+type: 'UPDATE_THEME_INFO',
+payload: Shape<GlobalThemeInfo>,
}
| {
+type: 'ADD_KEYSERVER',
+payload: AddKeyserverPayload,
};

export type ActionPayload = ?(Object | Array<*> | $ReadOnlyArray<*> | string);
Expand Down

0 comments on commit 07c3986

Please sign in to comment.