-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
base: main
Are you sure you want to change the base?
Conversation
1198bf6
to
8d0712d
Compare
@@ -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) { |
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.
if (ref.current != null && value) { | |
if (ref.current !== null && value) { |
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.
fixed
@@ -42,6 +42,10 @@ const Select = <T extends object>( | |||
const [selectedOption, setSelectedOption] = useState(value); | |||
const [showOptions, setShowOptions] = useState(false); | |||
|
|||
useEffect(() => { |
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.
what is the case where the value is changed from the outside that we need this effect
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.
without this useEffect, filters won't be applied when url params are empty and we take them from localStorage
}); | ||
}; | ||
|
||
const removeMessagesFiltersField = (key: keyof MessagesFilterFieldsType) => { |
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.
const removeMessagesFiltersField = (key: keyof MessagesFilterFieldsType) => { | |
const removeMessagesFiltersField = (key: MessagesFilterFieldsType) => { |
because keys and values are the same we can use it like this
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.
8d0712d
to
9407cdb
Compare
Resolves: #440