mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-05 22:10:10 +00:00
Merge pull request #1333 from KoalaSat/update-order-nav-bar-on-time
Update order navbar on time
This commit is contained in:
commit
10f88e3b5d
@ -67,9 +67,11 @@ const RobotProfile = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleChangeSlot = (e: SelectChangeEvent<number | 'loading'>): void => {
|
const handleChangeSlot = (e: SelectChangeEvent<number | 'loading'>): void => {
|
||||||
garage.currentSlot = e.target.value;
|
if (e?.target?.value) {
|
||||||
setInputToken(garage.getSlot()?.token ?? '');
|
garage.setCurrentSlot(e.target.value as string);
|
||||||
setLoading(true);
|
setInputToken(garage.getSlot()?.token ?? '');
|
||||||
|
setLoading(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const slot = garage.getSlot();
|
const slot = garage.getSlot();
|
||||||
|
@ -71,7 +71,7 @@ const RobotPage = (): JSX.Element => {
|
|||||||
encPrivKey: key.encryptedPrivateKeyArmored,
|
encPrivKey: key.encryptedPrivateKeyArmored,
|
||||||
});
|
});
|
||||||
void federation.fetchRobot(garage, token);
|
void federation.fetchRobot(garage, token);
|
||||||
garage.currentSlot = token;
|
garage.setCurrentSlot(token);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
|
@ -106,6 +106,11 @@ class Garage {
|
|||||||
return slot;
|
return slot;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setCurrentSlot: (currentSlot: string) => void = (currentSlot) => {
|
||||||
|
this.currentSlot = currentSlot;
|
||||||
|
this.triggerHook('onRobotUpdate');
|
||||||
|
};
|
||||||
|
|
||||||
// Robots
|
// Robots
|
||||||
createRobot: (token: string, shortAliases: string[], attributes: Record<any, any>) => void = (
|
createRobot: (token: string, shortAliases: string[], attributes: Record<any, any>) => void = (
|
||||||
token,
|
token,
|
||||||
|
Loading…
Reference in New Issue
Block a user