@ -62,6 +62,13 @@ export function normalizeStatus(status, normalOldStatus) {
normalStatus . spoilerHtml = normalOldStatus . get ( 'spoilerHtml' ) ;
normalStatus . spoilerHtml = normalOldStatus . get ( 'spoilerHtml' ) ;
normalStatus . hidden = normalOldStatus . get ( 'hidden' ) ;
normalStatus . hidden = normalOldStatus . get ( 'hidden' ) ;
} else {
} else {
// If the status has a CW but no contents, treat the CW as if it were the
// status' contents, to avoid having a CW toggle with seemingly no effect.
if ( normalStatus . spoiler _text && ! normalStatus . content ) {
normalStatus . content = normalStatus . spoiler _text ;
normalStatus . spoiler _text = '' ;
}
const spoilerText = normalStatus . spoiler _text || '' ;
const spoilerText = normalStatus . spoiler _text || '' ;
const searchContent = ( [ spoilerText , status . content ] . concat ( ( status . poll && status . poll . options ) ? status . poll . options . map ( option => option . title ) : [ ] ) ) . join ( '\n\n' ) . replace ( /<br\s*\/?>/g , '\n' ) . replace ( /<\/p><p>/g , '\n\n' ) ;
const searchContent = ( [ spoilerText , status . content ] . concat ( ( status . poll && status . poll . options ) ? status . poll . options . map ( option => option . title ) : [ ] ) ) . join ( '\n\n' ) . replace ( /<br\s*\/?>/g , '\n' ) . replace ( /<\/p><p>/g , '\n\n' ) ;
const emojiMap = makeEmojiMap ( normalStatus ) ;
const emojiMap = makeEmojiMap ( normalStatus ) ;