Skip to content

Commit

Permalink
Merge pull request #7242 from p12tic/www-add-missing-observer
Browse files Browse the repository at this point in the history
www: Add missing observer usages in several places
  • Loading branch information
p12tic committed Dec 4, 2023
2 parents 6a1b1d4 + c9c4246 commit 2e7eac7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions www/react-base/src/components/BuildSticker/BuildSticker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Copyright Buildbot Team Members
*/

import './BuildSticker.scss'
import './BuildSticker.scss';
import {observer} from "mobx-react";
import {Link} from "react-router-dom";
import { Card } from 'react-bootstrap';
import {Build, Builder, results2class, results2text} from "buildbot-data-js";
Expand All @@ -26,7 +27,7 @@ type BuildStickerProps = {
builder: Builder;
}

export const BuildSticker = ({build, builder}: BuildStickerProps) => {
export const BuildSticker = observer(({build, builder}: BuildStickerProps) => {
const now = useCurrentTime();

return (
Expand All @@ -49,4 +50,4 @@ export const BuildSticker = ({build, builder}: BuildStickerProps) => {
</Card.Body>
</Card>
);
}
});
5 changes: 3 additions & 2 deletions www/react-ui/src/components/ChangeDetails/ChangeDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import './ChangeDetails.scss';
import {useState} from "react";
import {observer} from "mobx-react";
import {OverlayTrigger, Popover, Table} from "react-bootstrap";
import {Change, parseChangeAuthorNameAndEmail} from "buildbot-data-js";
import {dateFormat, durationFromNowFormat, useCurrentTime} from "../../util/Moment";
Expand All @@ -30,7 +31,7 @@ type ChangeDetailsProps = {
setShowDetails: (show: boolean) => void;
}

export const ChangeDetails = ({change, compact, showDetails, setShowDetails}: ChangeDetailsProps) => {
export const ChangeDetails = observer(({change, compact, showDetails, setShowDetails}: ChangeDetailsProps) => {
const now = useCurrentTime();
const [showProps, setShowProps] = useState(false);

Expand Down Expand Up @@ -137,4 +138,4 @@ export const ChangeDetails = ({change, compact, showDetails, setShowDetails}: Ch
{showDetails ? renderChangeDetails() : <></>}
</div>
);
}
});

0 comments on commit 2e7eac7

Please sign in to comment.