-
Notifications
You must be signed in to change notification settings - Fork 7
chore: fix all code review comments #2021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -455,7 +455,8 @@ export const ProposalCreationForm = ({ | |
| const ownsDraft = Boolean( | ||
| ownedDraft && | ||
| address && | ||
| ownedDraft.author.toLowerCase() === address.toLowerCase(), | ||
| // Legacy localStorage drafts predate the `author` field and may lack it. | ||
| ownedDraft.author?.toLowerCase() === address.toLowerCase(), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the API migration/fetch fails, Useful? React with 👍 / 👎. |
||
| ); | ||
| const isRecipient = Boolean(draftId) && !drafts.isLoading && !ownsDraft; | ||
| // Editor only for a new proposal or an owned draft (no load-dependent flash). | ||
|
|
@@ -496,11 +497,14 @@ export const ProposalCreationForm = ({ | |
| : draftPreviewCopy({ role: "author" }); | ||
|
|
||
| // Recipients can only ever see the Preview — they have no editor access. | ||
| // Gated on draftContentLoaded so a not-yet-resolved ownership check (drafts | ||
| // still loading on mount) can't misclassify an owner as a recipient and | ||
| // force their own draft into Preview. | ||
| useEffect(() => { | ||
| if (isRecipient && view !== "preview") { | ||
| if (isRecipient && draftContentLoaded && view !== "preview") { | ||
| void setView("preview"); | ||
| } | ||
| }, [isRecipient, view, setView]); | ||
| }, [isRecipient, draftContentLoaded, view, setView]); | ||
|
|
||
| const proposalsListHref = `${basePath}/proposals`; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TORN proposals created before their voting window are persisted as PENDING, and
TORNClient.getProposalStatuslater derives QUEUED/PENDING_EXECUTION from that same row. With this prefilter,status=QUEUEDonly fetches QUEUED/ACTIVE rows, so those delayed TORN proposals are never hydrated and disappear from queued-status feeds; include PENDING here and in the PENDING_EXECUTION branch.Useful? React with 👍 / 👎.