Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3397304
D8236.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8236.diff
View Options
diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js
--- a/keyserver/src/responders/website-responders.js
+++ b/keyserver/src/responders/website-responders.js
@@ -27,6 +27,7 @@
import { defaultWebEnabledApps } from 'lib/types/enabled-apps.js';
import { entryStoreValidator } from 'lib/types/entry-types.js';
import { defaultCalendarFilters } from 'lib/types/filter-types.js';
+import { inviteLinksStoreValidator } from 'lib/types/link-types.js';
import {
defaultNumberPerThread,
messageStoreValidator,
@@ -51,6 +52,7 @@
import { navInfoFromURL } from 'web/url-utils.js';
import { fetchEntryInfos } from '../fetchers/entry-fetchers.js';
+import { fetchPrimaryInviteLinks } from '../fetchers/link-fetchers.js';
import { fetchMessageInfos } from '../fetchers/message-fetchers.js';
import { hasAnyNotAcknowledgedPolicies } from '../fetchers/policy-acknowledgment-fetchers.js';
import { fetchThreadInfos } from '../fetchers/thread-fetchers.js';
@@ -242,6 +244,7 @@
pushApiPublicKey: t.maybe(t.String),
_persist: t.Nil,
commServicesAccessToken: t.Nil,
+ inviteLinksStore: inviteLinksStoreValidator,
});
async function websiteResponder(
@@ -471,6 +474,21 @@
return pushConfig.publicKey;
})();
+ const inviteLinksStorePromise = (async () => {
+ const primaryInviteLinks = await fetchPrimaryInviteLinks(viewer);
+ const links = {};
+ for (const link of primaryInviteLinks) {
+ if (link.primary) {
+ links[link.communityID] = {
+ primaryLink: link,
+ };
+ }
+ }
+ return {
+ links,
+ };
+ })();
+
const { jsURL, fontsURL, cssInclude, olmFilename, sqljsFilename, opaqueURL } =
await assetInfoPromise;
@@ -565,6 +583,7 @@
pushApiPublicKey: pushApiPublicKeyPromise,
_persist: null,
commServicesAccessToken: null,
+ inviteLinksStore: inviteLinksStorePromise,
});
const validatedInitialReduxState = validateOutput(
viewer.platformDetails,
diff --git a/lib/types/link-types.js b/lib/types/link-types.js
--- a/lib/types/link-types.js
+++ b/lib/types/link-types.js
@@ -55,6 +55,15 @@
export type InviteLinksStore = {
+links: InviteLinks,
};
+export const inviteLinksStoreValidator: TInterface<InviteLinksStore> =
+ tShape<InviteLinksStore>({
+ links: t.dict(
+ tID,
+ tShape<CommunityLinks>({
+ primaryLink: t.maybe(inviteLinkValidator),
+ }),
+ ),
+ });
export type CreateOrUpdatePublicLinkRequest = {
+name: string,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 5:13 PM (19 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608290
Default Alt Text
D8236.diff (2 KB)
Attached To
Mode
D8236: [keyserver] Return invite links in initial web state
Attached
Detach File
Event Timeline
Log In to Comment