mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 01:50:47 -04:00
overseer disableable
This commit is contained in:
@@ -40,7 +40,7 @@ function OverseerMemoryPopup({ memory, onClose }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default function OverseerPreferencePanel() {
|
||||
function OverseerPreferencePanelBody() {
|
||||
const { identifySession } = useSessionActions();
|
||||
const vote = useSessionSelector((state) => state.session?.overseerVote || null);
|
||||
const overseerMemory = useSessionSelector((state) => state.overseerMemory || null);
|
||||
@@ -102,3 +102,21 @@ export default function OverseerPreferencePanel() {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function OverseerPreferencePanel() {
|
||||
const visible = useSessionSelector((state) => {
|
||||
const vote = state.session?.overseerVote;
|
||||
|
||||
// The server owns whether voting has any effect. The panel appears only
|
||||
// when the autonomous vote-gated scheduler is active; direct-address mode
|
||||
// is intentionally hidden because users invoke it by starting a chat
|
||||
// message with the configured overseer name instead of voting it on.
|
||||
return Boolean(vote?.votingEnabled);
|
||||
});
|
||||
|
||||
if (!visible) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <OverseerPreferencePanelBody />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user