Skip to content
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

FE: Topics: Remember user polling options #453

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Nilumilak
Copy link
Member

Resolves: #440

@Nilumilak Nilumilak added type/enhancement En enhancement/improvement to an already existing feature scope/frontend Related to frontend changes area/topics area/messages labels Jun 23, 2024
@Nilumilak Nilumilak self-assigned this Jun 23, 2024
@Nilumilak Nilumilak requested a review from a team as a code owner June 23, 2024 22:01
@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Jun 23, 2024
@Nilumilak Nilumilak added status/needs-attention Collective discussion is required and removed status/needs-attention Collective discussion is required labels Jun 23, 2024
@Nilumilak Nilumilak force-pushed the feature/user-polling-options branch from 1198bf6 to 8d0712d Compare July 15, 2024 07:38
@Haarolean Haarolean added the hacktoberfest-accepted PRs accepted towards hacktoberfest goal and will be counted as approved label Oct 4, 2024
@Haarolean Haarolean added this to the 1.2 milestone Oct 16, 2024
@Haarolean Haarolean removed the status/triage/manual Manual triage in progress label Dec 20, 2024
@@ -31,6 +31,12 @@ const Search: React.FC<SearchProps> = ({
const [searchParams, setSearchParams] = useSearchParams();
const ref = useRef<ComponentRef<'input'>>(null);

useEffect(() => {
if (ref.current != null && value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (ref.current != null && value) {
if (ref.current !== null && value) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -42,6 +42,10 @@ const Select = <T extends object>(
const [selectedOption, setSelectedOption] = useState(value);
const [showOptions, setShowOptions] = useState(false);

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the case where the value is changed from the outside that we need this effect

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this useEffect, filters won't be applied when url params are empty and we take them from localStorage

});
};

const removeMessagesFiltersField = (key: keyof MessagesFilterFieldsType) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const removeMessagesFiltersField = (key: keyof MessagesFilterFieldsType) => {
const removeMessagesFiltersField = (key: MessagesFilterFieldsType) => {

because keys and values are the same we can use it like this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but then typescript won't like it
image

@Nilumilak Nilumilak force-pushed the feature/user-polling-options branch from 8d0712d to 9407cdb Compare January 8, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/messages area/topics hacktoberfest-accepted PRs accepted towards hacktoberfest goal and will be counted as approved scope/frontend Related to frontend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

FE: Topics: Remember user polling options
4 participants