Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Merge pull request #1420 from ecency/bugfix/decks-opening
Browse files Browse the repository at this point in the history
Decks: fixed opening
  • Loading branch information
feruzm authored Jul 23, 2023
2 parents 30159b8 + e84c415 commit a7cecad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/common/components/decks/deck-threads-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const DeckThreadsForm = ({
useEffect(() => {
if (persistable) {
setThreadHost(threadHost ? threadHost : persistedForm?.threadHost);
setText(text ? text : persistedForm?.text);
setText(text ? text : persistedForm?.text ?? "");
setImage(image ? image : persistedForm?.image);
setImageName(imageName ? imageName : persistedForm?.imageName);
}
Expand Down Expand Up @@ -172,12 +172,12 @@ export const DeckThreadsForm = ({
className={"deck-toolbar-threads-form-submit "}
size={size}
>
{!activeUser && !entry && text!!.length <= 255 && _t("decks.threads-form.login-and-publish")}
{!activeUser && !entry && text?.length <= 255 && _t("decks.threads-form.login-and-publish")}
{activeUser &&
!entry &&
text!!.length <= 255 &&
text?.length <= 255 &&
(loading ? _t("decks.threads-form.publishing") : _t("decks.threads-form.publish"))}
{text!!.length > 255 && !entry && _t("decks.threads-form.create-regular-post")}
{text?.length > 255 && !entry && _t("decks.threads-form.create-regular-post")}
{entry && _t("decks.threads-form.save")}
</Button>
);
Expand Down Expand Up @@ -239,12 +239,12 @@ export const DeckThreadsForm = ({
)}
</div>
</div>
{inline && text!!.length > 255 && (
{inline && text?.length > 255 && (
<Alert variant="warning">{_t("decks.threads-form.max-length")}</Alert>
)}
{!inline && (
<div className="deck-toolbar-threads-form-bottom">
{text!!.length > 255 && (
{text?.length > 255 && (
<Alert variant="warning">{_t("decks.threads-form.max-length")}</Alert>
)}
<DeckThreadsCreatedRecently
Expand Down

0 comments on commit a7cecad

Please sign in to comment.