Skip to content

Commit

Permalink
Merge pull request #446 from cheeaun/main
Browse files Browse the repository at this point in the history
Update from main
  • Loading branch information
cheeaun authored Mar 7, 2024
2 parents 6827a38 + 306a96e commit aed8422
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 21 deletions.
7 changes: 7 additions & 0 deletions src/components/account-block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function AccountBlock({
group,
followersCount,
createdAt,
locked,
} = account;
let [_, acct1, acct2] = acct.match(/([^@]+)(@.+)/i) || [, acct];
if (accountInstance) {
Expand Down Expand Up @@ -123,6 +124,12 @@ function AccountBlock({
@{acct1}
<wbr />
{acct2}
{locked && (
<>
{' '}
<Icon icon="lock" size="s" alt="Locked" />
</>
)}
</span>
{showActivity && (
<>
Expand Down
8 changes: 4 additions & 4 deletions src/components/report-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ function ReportModal({ account, post, onClose }) {
disabled={uiState === 'loading'}
/>
</section>
<section>
{domain !== currentDomain && (
{!!domain && domain !== currentDomain && (
<section>
<p>
<label>
<input
Expand All @@ -247,8 +247,8 @@ function ReportModal({ account, post, onClose }) {
</span>
</label>
</p>
)}
</section>
</section>
)}
<footer>
<button type="submit" disabled={uiState === 'loading'}>
Send Report
Expand Down
2 changes: 1 addition & 1 deletion src/components/search-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const SearchForm = forwardRef((props, ref) => {
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
spellCheck="false"
onSearch={(e) => {
if (!e.target.value) {
setSearchParams({});
Expand Down
2 changes: 1 addition & 1 deletion src/components/shortcuts-settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ function ShortcutForm({
}
autocorrect="off"
autocapitalize="off"
spellcheck={false}
spellCheck={false}
pattern={pattern}
/>
{currentType === 'hashtag' &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ function Status({
}}
>
<Icon icon="code" />
<span>Embed</span>
<span>Embed post</span>
</MenuItem>
)}
{(isSelf || mentionSelf) && <MenuDivider />}
Expand Down
28 changes: 18 additions & 10 deletions src/pages/catchup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ import { oklab2rgb, rgb2oklab } from '../utils/color-utils';
import db from '../utils/db';
import emojifyText from '../utils/emojify-text';
import { isFiltered } from '../utils/filters';
import getHTMLText from '../utils/getHTMLText';
import htmlContentLength from '../utils/html-content-length';
import niceDateTime from '../utils/nice-date-time';
import shortenNumber from '../utils/shorten-number';
import showToast from '../utils/show-toast';
import states, { statusKey } from '../utils/states';
import statusPeek from '../utils/status-peek';
import store from '../utils/store';
import { getCurrentAccountNS } from '../utils/store-utils';
import { assignFollowedTags } from '../utils/timeline-utils';
Expand Down Expand Up @@ -1484,7 +1484,7 @@ function PostPeek({ post, filterInfo }) {
const isThread =
(inReplyToId && inReplyToAccountId === account.id) || !!_thread;
const showMedia = !spoilerText && !sensitive;
const postText = content ? getHTMLText(content) : '';
const postText = content ? statusPeek(post) : '';

return (
<div class="post-peek" title={!spoilerText ? postText : ''}>
Expand Down Expand Up @@ -1518,19 +1518,27 @@ function PostPeek({ post, filterInfo }) {
<span class="post-peek-tag post-peek-thread">Thread</span>{' '}
</>
)}
{content ? (
{!!content && (
<div
dangerouslySetInnerHTML={{
__html: emojifyText(content, emojis),
}}
/>
) : mediaAttachments?.length === 1 &&
mediaAttachments[0].description ? (
<>
<span class="post-peek-tag post-peek-alt">ALT</span>{' '}
<div>{mediaAttachments[0].description}</div>
</>
) : null}
)}
{!!poll?.options?.length &&
poll.options.map((o) => (
<div>
{poll.multiple ? '▪️' : '•'} {o.title}
</div>
))}
{!content &&
mediaAttachments?.length === 1 &&
mediaAttachments[0].description && (
<>
<span class="post-peek-tag post-peek-alt">ALT</span>{' '}
<div>{mediaAttachments[0].description}</div>
</>
)}
</div>
)}
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/hashtag.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function Hashtags({ media: mediaView, columnMode, ...props }) {
required
autocorrect="off"
autocapitalize="off"
spellcheck={false}
spellCheck={false}
// no spaces, no hashtags
pattern="[^#][^\s#]+[^#]"
disabled={reachLimit}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function Login() {
autocorrect="off"
autocapitalize="off"
autocomplete="off"
spellcheck={false}
spellCheck={false}
placeholder="instance domain"
onInput={(e) => {
setInstanceText(e.target.value);
Expand Down
3 changes: 3 additions & 0 deletions src/pages/notifications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ function Notifications({ columnMode }) {
lastHiddenTime.current = Date.now();
}
unsub = subscribeKey(states, 'notificationsShowNew', (v) => {
if (uiState === 'loading') {
return;
}
if (v) {
loadUpdates();
}
Expand Down
6 changes: 4 additions & 2 deletions src/utils/status-peek.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ function statusPeek(status) {
text += getHTMLText(content);
}
text = text.trim();
if (poll) {
text += ' 📊';
if (poll?.options?.length) {
text += `\n\n📊:\n${poll.options
.map((o) => `${poll.multiple ? '▪️' : '•'} ${o.title}`)
.join('\n')}`;
}
if (mediaAttachments?.length) {
text +=
Expand Down

0 comments on commit aed8422

Please sign in to comment.