mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 04:08:32 +03:00
Experiment auto-expand spoiler in hero status
This commit is contained in:
parent
1b1af67064
commit
ad7cb46547
1 changed files with 12 additions and 0 deletions
|
@ -984,6 +984,18 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
|
|||
[statuses, limit, renderStatus],
|
||||
);
|
||||
|
||||
// If there's spoiler in hero status, auto-expand it
|
||||
useEffect(() => {
|
||||
let timer = setTimeout(() => {
|
||||
if (!heroStatusRef.current) return;
|
||||
const spoilerButton = heroStatusRef.current.querySelector(
|
||||
'.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)',
|
||||
);
|
||||
if (spoilerButton) spoilerButton.click();
|
||||
}, 1000);
|
||||
return () => clearTimeout(timer);
|
||||
}, [id]);
|
||||
|
||||
return (
|
||||
<div
|
||||
tabIndex="-1"
|
||||
|
|
Loading…
Add table
Reference in a new issue