Skip to content

Commit

Permalink
increase post character limit to 1500 for supporters
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Nov 19, 2024
1 parent daaf85d commit 8afd847
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/PostsArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import { AdvancedMarkupOptions } from "./advanced-markup-options/AdvancedMarkupO
import { PostItem } from "./post-area/PostItem";
import { MetaTitle } from "@/common/MetaTitle";
import DropDown from "./ui/drop-down/DropDown";
import { hasBit, USER_BADGES } from "@/chat-api/Bitwise";

const PhotoEditor = lazy(() => import("./ui/photo-editor/PhotoEditor"));

Expand Down Expand Up @@ -91,7 +92,10 @@ function NewPostArea(props: {
postId?: string;
primaryColor?: string;
}) {
const { posts } = useStore();
const { posts, account } = useStore();

const isSupporter = () =>
hasBit(account.user()?.badges || 0, USER_BADGES.SUPPORTER.bit);
const [content, setContent] = createSignal("");
const { isPortalOpened } = useCustomPortal();
const [attachedFile, setAttachedFile] = createSignal<File | undefined>(
Expand Down Expand Up @@ -209,7 +213,7 @@ function NewPostArea(props: {
>
<Input
primaryColor={props.primaryColor}
maxLength={500}
maxLength={isSupporter() ? 1500 : 500}
margin={[0, 0, 4, 0]}
onBlur={() => setTimeout(() => setInputFocused(false), 100)}
onFocus={() => setTimeout(() => setInputFocused(true), 100)}
Expand Down

0 comments on commit 8afd847

Please sign in to comment.