优化付费内容的显隐
This commit is contained in:
parent
bb26b62cc1
commit
d132076ff3
|
@ -240,7 +240,8 @@ export default function PostItem({
|
|||
{!(
|
||||
!data?.is_zone_moment_unlocked && data?.text_visible_range < 999
|
||||
) &&
|
||||
(data.text?.length > 140 || getcountLines(data.text) > 1) && (
|
||||
(data.text?.length > 140 ||
|
||||
getcountLines(data.paid_text || "") > 1) && (
|
||||
<div
|
||||
className="font-bold text-btn my-4 text-base"
|
||||
onClick={() => setIsOpenText(!isOpenText)}
|
||||
|
|
|
@ -153,6 +153,7 @@ export function getVideoBase64(url) {
|
|||
}
|
||||
|
||||
export function getcountLines(str) {
|
||||
const lines = str.split("\n").filter((line) => line.trim() !== "");
|
||||
const newStr = str.startsWith("\n") ? str.slice(1) : str;
|
||||
const lines = newStr.split("\n").filter((line) => line.trim() !== "");
|
||||
return lines.length;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue