mirror of
https://github.com/Reckless-Satoshi/robosats.git
synced 2024-08-16 15:20:55 +03: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 => {
|
||||
garage.currentSlot = e.target.value;
|
||||
setInputToken(garage.getSlot()?.token ?? '');
|
||||
setLoading(true);
|
||||
if (e?.target?.value) {
|
||||
garage.setCurrentSlot(e.target.value as string);
|
||||
setInputToken(garage.getSlot()?.token ?? '');
|
||||
setLoading(true);
|
||||
}
|
||||
};
|
||||
|
||||
const slot = garage.getSlot();
|
||||
|
@ -71,7 +71,7 @@ const RobotPage = (): JSX.Element => {
|
||||
encPrivKey: key.encryptedPrivateKeyArmored,
|
||||
});
|
||||
void federation.fetchRobot(garage, token);
|
||||
garage.currentSlot = token;
|
||||
garage.setCurrentSlot(token);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
|
@ -106,6 +106,11 @@ class Garage {
|
||||
return slot;
|
||||
};
|
||||
|
||||
setCurrentSlot: (currentSlot: string) => void = (currentSlot) => {
|
||||
this.currentSlot = currentSlot;
|
||||
this.triggerHook('onRobotUpdate');
|
||||
};
|
||||
|
||||
// Robots
|
||||
createRobot: (token: string, shortAliases: string[], attributes: Record<any, any>) => void = (
|
||||
token,
|
||||
|
Loading…
Reference in New Issue
Block a user