Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3513304
D6870.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
D6870.diff
View Options
diff --git a/lib/shared/messages/sidebar-source-message-spec.js b/lib/shared/messages/sidebar-source-message-spec.js
--- a/lib/shared/messages/sidebar-source-message-spec.js
+++ b/lib/shared/messages/sidebar-source-message-spec.js
@@ -6,13 +6,11 @@
pushTypes,
type CreateMessageInfoParams,
type MessageSpec,
- type NotificationTextsParams,
type RawMessageInfoFromServerDBRowParams,
} from './message-spec.js';
-import { assertSingleMessageInfo, joinResult } from './utils.js';
+import { joinResult } from './utils.js';
import type { PlatformDetails } from '../../types/device-types.js';
import type {
- MessageInfo,
RawSidebarSourceMessageInfo,
SidebarSourceMessageData,
SidebarSourceMessageInfo,
@@ -21,7 +19,6 @@
import { messageTypes } from '../../types/message-types.js';
import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { hasMinCodeVersion } from '../version-utils.js';
@@ -137,7 +134,6 @@
rawMessageInfo: RawSidebarSourceMessageInfo,
platformDetails: ?PlatformDetails,
): RawSidebarSourceMessageInfo | RawUnsupportedMessageInfo {
- // TODO determine min code version
if (
hasMinCodeVersion(platformDetails, 75) &&
rawMessageInfo.sourceMessage
@@ -164,18 +160,11 @@
return unwrapped;
},
- async notificationTexts(
- messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
- params: NotificationTextsParams,
- ): Promise<NotifTexts> {
- const messageInfo = assertSingleMessageInfo(messageInfos);
+ notificationTexts(): Promise<NotifTexts> {
invariant(
- messageInfo.type === messageTypes.SIDEBAR_SOURCE,
- 'messageInfo should be messageTypes.SIDEBAR_SOURCE!',
+ false,
+ 'SIDEBAR_SOURCE notificationTexts should never be called directly!',
);
- const sourceMessageInfo = messageInfo.sourceMessage;
- return await params.notificationTexts([sourceMessageInfo], threadInfo);
},
notificationCollapseKey(rawMessageInfo: RawSidebarSourceMessageInfo): string {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 11:34 PM (13 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692885
Default Alt Text
D6870.diff (2 KB)
Attached To
Mode
D6870: [lib] Add invariant to SidebarSource notificationTexts
Attached
Detach File
Event Timeline
Log In to Comment