Skip to content

Commit

Permalink
fix: remove unnecessary setUITimezone call
Browse files Browse the repository at this point in the history
Signed-off-by: Isitha Subasinghe <isitha@pipekit.io>
  • Loading branch information
isubasinghe committed Dec 12, 2022
1 parent d907484 commit 629a0e3
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ export const WorkflowLogsViewer = ({workflow, nodeId, initialPodName, container,
const [uiTimezone, setUITimezone] = useState<string>(DEFAULT_TZ);
// timezone used for timezone formatting
const [timezone, setTimezone] = useLocalStorage<string>(TZ_LOCALSTORAGE_KEY, DEFAULT_TZ);
// list of timezones moment tz supports
// list of timezones the moment-timezone library supports
const [timezones, setTimezones] = useState<string[]>([]);

// update the UI everytime the timezone changes
useEffect(() => {
setUITimezone(timezone);
}, [timezone]);
Expand Down Expand Up @@ -194,10 +195,8 @@ export const WorkflowLogsViewer = ({workflow, nodeId, initialPodName, container,
items={filteredTimezones}
value={uiTimezone}
onChange={v => setUITimezone(v.target.value)}
onSelect={tz => {
setUITimezone(tz);
setTimezone(tz);
}}
// useEffect ensures UITimezone is also changed
onSelect={setTimezone}
/>
</div>
</span>
Expand Down

0 comments on commit 629a0e3

Please sign in to comment.