-
Notifications
You must be signed in to change notification settings - Fork 1
Announcement Preview and Link Button #1139
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
base: main
Are you sure you want to change the base?
Conversation
server/src/db/migrations/20251016175110_announcement-link-columns.ts
Outdated
Show resolved
Hide resolved
cowsed
left a comment
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.
I like the default to https, thats really nice. just the one thing about the switch and i think this is good
| const navigate = useNavigate(); | ||
|
|
||
|
|
||
| const [showLinkFields, setShowLinkFields] = useState(!!announcementDraft.linkUrl || !!announcementDraft.linkText); |
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.
When testing this, it seems like the default value of this isnt getting calculated just right. If i add a link and link text to an announcement, then save and close it, then reopen it, the Link Button switch is set to off. If i turn it on manually it shows the saved fields just fine though
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.
I recently pushed a commit (64e5ce4) to remedy this. The useEffect looks clunky to me but I could be overthinking it.
Closes: #1062
Closes: #1054