Skip to content

Commit 85e09df

Browse files
committed
fix: Read more button always shown
1 parent 098e720 commit 85e09df

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
- Type: changes
66
-->
77

8+
## 2023.10.2
9+
- UI: fixed read more button always shown
10+
811
## 2023.10.1
912
- Dev: move files from `app/` to `src/`
1013
- Dev: cache translation instead always requesting new one

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ghostbox",
3-
"version": "2023.10.1",
3+
"version": "2023.10.2",
44
"displayName": "Ghostbox",
55
"description": "An alternative frontend for Akkoma",
66
"homepage": "https://fedi.aap.my.id",

src/soapbox/components/status-content.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const StatusContent: React.FC<IStatusContent> = ({
3434
}) => {
3535
const history = useHistory();
3636

37+
const [isCollapsable, setCollapsable] = useState(false);
3738
const [collapsed, setCollapsed] = useState(false);
3839
const [onlyEmoji, setOnlyEmoji] = useState(false);
3940

@@ -102,6 +103,7 @@ const StatusContent: React.FC<IStatusContent> = ({
102103

103104
if (collapsable && !collapsed) {
104105
if (node.current.clientHeight > MAX_HEIGHT) {
106+
setCollapsable(true);
105107
setCollapsed(true);
106108
}
107109
}
@@ -161,7 +163,7 @@ const StatusContent: React.FC<IStatusContent> = ({
161163
/>,
162164
];
163165

164-
if (collapsable && collapsed) {
166+
if (isCollapsable && collapsed) {
165167
output.push(
166168
<div className='flex w-full justify-center pt-2' role='button' tabIndex={0} onClick={toggleCollapsed}>
167169
<Button
@@ -181,7 +183,7 @@ const StatusContent: React.FC<IStatusContent> = ({
181183
output.push(<Poll id={status.poll} key='poll' status={status.url} />);
182184
}
183185

184-
if (collapsable && !collapsed) {
186+
if (isCollapsable && !collapsed) {
185187
output.push(
186188
<div className='flex w-full justify-center pt-2' role='button' tabIndex={0} onClick={toggleCollapsed}>
187189
<Button

0 commit comments

Comments
 (0)