Skip to content

Commit

Permalink
Trigger interactive sync when clicking on interactive status
Browse files Browse the repository at this point in the history
  • Loading branch information
dumdum7 authored Dec 27, 2024
1 parent 0621d87 commit 967ac8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions ui/v2.5/src/hooks/Interactive/interactive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ div.scene-interactive-status {
opacity: 0.75;
padding: 0.75rem;
position: absolute;
cursor: pointer;

&.interactive-status-disconnected,
&.interactive-status-error svg {
Expand Down
8 changes: 6 additions & 2 deletions ui/v2.5/src/hooks/Interactive/status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "./context";

export const SceneInteractiveStatus: React.FC = ({}) => {
const { state, error } = React.useContext(InteractiveContext);
const { state, error, sync } = React.useContext(InteractiveContext);

function getStateClass() {
switch (state) {
Expand All @@ -35,11 +35,15 @@ export const SceneInteractiveStatus: React.FC = ({}) => {
}

return (
<div className={`scene-interactive-status ${getStateClass()}`}>
<div
className={`scene-interactive-status ${getStateClass()}`}
onClick={() => sync()}
>
<FontAwesomeIcon pulse icon={faCircle} size="xs" />
<span className="status-text">
<FormattedMessage id={connectionStateLabel(state)} />
{error && <span>: {error}</span>}
&nbsp;({serverOffset.toFixed()}ms)
</span>
</div>
);
Expand Down

0 comments on commit 967ac8b

Please sign in to comment.