Skip to content
Snippets Groups Projects
Unverified Commit c4115828 authored by Nick Fitzpatrick's avatar Nick Fitzpatrick Committed by GitHub
Browse files

Don't lower dashboard/question title when there is no last edit info (#38629)

* don't lower dashboard title when there is no last edit info

* same with questions
parent 0b06c1da
No related branches found
No related tags found
No related merge requests found
......@@ -91,10 +91,12 @@ export function DashboardHeaderComponent({
useEffect(() => {
const timerId = setTimeout(() => {
setShowSubHeader(false);
if (isLastEditInfoVisible) {
setShowSubHeader(false);
}
}, 4000);
return () => clearTimeout(timerId);
}, []);
}, [isLastEditInfoVisible]);
return (
<div>
......
......@@ -222,13 +222,6 @@ function SavedQuestionLeftSide(props) {
const [showSubHeader, setShowSubHeader] = useState(true);
useEffect(() => {
const timerId = setTimeout(() => {
setShowSubHeader(false);
}, 4000);
return () => clearTimeout(timerId);
}, []);
const hasLastEditInfo = question.lastEditInfo() != null;
const isDataset = question.isDataset();
......@@ -241,6 +234,18 @@ function SavedQuestionLeftSide(props) {
[question, onSave],
);
const renderDataSource = QuestionDataSource.shouldRender(props) && !isDataset;
const renderLastEdit = hasLastEditInfo && isAdditionalInfoVisible;
useEffect(() => {
const timerId = setTimeout(() => {
if (isAdditionalInfoVisible && (renderDataSource || renderLastEdit)) {
setShowSubHeader(false);
}
}, 4000);
return () => clearTimeout(timerId);
}, [isAdditionalInfoVisible, renderDataSource, renderLastEdit]);
return (
<SavedQuestionLeftSideRoot
data-testid="qb-header-left-side"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment