diff --git a/src/social-network-provider/facebook.com/UI/collectPosts.tsx b/src/social-network-provider/facebook.com/UI/collectPosts.tsx index 67ca0889f150..11e2ed595f32 100644 --- a/src/social-network-provider/facebook.com/UI/collectPosts.tsx +++ b/src/social-network-provider/facebook.com/UI/collectPosts.tsx @@ -9,6 +9,7 @@ import { makeTypedMessageText, makeTypedMessageImage, makeTypedMessageFromList, + makeTypedMessageCompound, } from '../../../protocols/typed-message' const posts = new LiveSelector().querySelectorAll( @@ -82,7 +83,7 @@ export function collectPostsFacebook(this: SocialNetworkUI) { info.postMetadataImages.add(url) nextTypedMessage.push(makeTypedMessageImage(url)) } - info.parsedPostContent.value = makeTypedMessageFromList(...nextTypedMessage) + info.parsedPostContent.value = makeTypedMessageCompound(nextTypedMessage) } collectPostInfo() info.postPayload.value = deconstructPayload(info.postContent.value, this.payloadDecoder) diff --git a/src/social-network-provider/twitter.com/ui/fetch.ts b/src/social-network-provider/twitter.com/ui/fetch.ts index 1ab620e01d91..23c097098524 100644 --- a/src/social-network-provider/twitter.com/ui/fetch.ts +++ b/src/social-network-provider/twitter.com/ui/fetch.ts @@ -20,6 +20,7 @@ import { makeTypedMessageEmpty, makeTypedMessageSuspended, serializeTypedMessage, + makeTypedMessageCompound, } from '../../../protocols/typed-message' const resolveLastRecognizedIdentity = (self: SocialNetworkUI) => { @@ -131,9 +132,6 @@ const registerPostCollector = (self: SocialNetworkUI) => { info.postContent.addListener((newValue) => { info.postPayload.value = deconstructPayload(newValue, self.payloadDecoder) }) - info.parsedPostContent.addListener((newValue) => { - // info.parsedPostContent.value = - }) injectMaskbookIconToPost(info) self.posts.set(proxy, info) return { @@ -199,5 +197,5 @@ function collectPostInfo(tweetNode: HTMLDivElement | null, info: PostInfo, self: }) .catch(() => makeTypedMessageEmpty()) - info.parsedPostContent.value = makeTypedMessageFromList(...messages, makeTypedMessageSuspended(images)) + info.parsedPostContent.value = makeTypedMessageCompound([...messages, makeTypedMessageSuspended(images)]) } diff --git a/src/social-network/PostInfo.ts b/src/social-network/PostInfo.ts index f1fee9c784b8..cdd4bdf34c10 100644 --- a/src/social-network/PostInfo.ts +++ b/src/social-network/PostInfo.ts @@ -18,9 +18,6 @@ export abstract class PostInfo { if (by.isUnknown || id === null) this.postIdentifier.value = null else this.postIdentifier.value = new PostIdentifier(by, id) } - if (process.env.NODE_ENV === 'development') { - this.parsedPostContent.addListener((x) => console.log(x)) - } this.postID.addListener(calc) this.postBy.addListener(calc) diff --git a/src/social-network/ui.ts b/src/social-network/ui.ts index c5cd5643281c..58823f4b4cd4 100644 --- a/src/social-network/ui.ts +++ b/src/social-network/ui.ts @@ -328,8 +328,8 @@ export function activateSocialNetworkUI(): void { function hookUIPostMap(ui: SocialNetworkUI) { const unmountFunctions = new WeakMap void>() ui.posts.event.on('set', (key, value) => { - const unmountPostDummy = ui.injectPostDummy(value) const unmountPostInspector = ui.injectPostInspector(value) + const unmountPostDummy = ui.injectPostDummy(value) const unmountCommentBox: () => void = ui.injectCommentBox === 'disabled' ? nopWithUnmount : defaultTo(ui.injectCommentBox, nopWithUnmount)(value) const unmountPostComments: () => void = @@ -337,8 +337,8 @@ function hookUIPostMap(ui: SocialNetworkUI) { ? nopWithUnmount : defaultTo(ui.injectPostComments, nopWithUnmount)(value) unmountFunctions.set(key, () => { - unmountPostDummy() unmountPostInspector() + unmountPostDummy() unmountCommentBox() unmountPostComments() })