mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-21 02:03:14 +00:00
Frontend 2
This commit is contained in:
@ -50,6 +50,7 @@ export const SuccessfulPrompt = ({
|
|||||||
|
|
||||||
const [coordinatorToken, setCoordinatorToken] = useState<string>();
|
const [coordinatorToken, setCoordinatorToken] = useState<string>();
|
||||||
const [hostRating, setHostRating] = useState<number>();
|
const [hostRating, setHostRating] = useState<number>();
|
||||||
|
const [tokenError, setTokenError] = useState<boolean>(false);
|
||||||
|
|
||||||
const rateHostPlatform = function (): void {
|
const rateHostPlatform = function (): void {
|
||||||
if (!hostRating) return;
|
if (!hostRating) return;
|
||||||
@ -57,13 +58,12 @@ export const SuccessfulPrompt = ({
|
|||||||
const slot = garage.getSlot();
|
const slot = garage.getSlot();
|
||||||
const coordinatorPubKey = federation.getCoordinator(order.shortAlias)?.nostrHexPubkey;
|
const coordinatorPubKey = federation.getCoordinator(order.shortAlias)?.nostrHexPubkey;
|
||||||
|
|
||||||
if (
|
if (!coordinatorToken) {
|
||||||
!coordinatorToken ||
|
setTokenError(true);
|
||||||
!slot?.nostrPubKey ||
|
return;
|
||||||
!slot.nostrSecKey ||
|
}
|
||||||
!coordinatorPubKey ||
|
|
||||||
!order.id
|
if (!slot?.nostrPubKey || !slot.nostrSecKey || !coordinatorPubKey || !order.id) {
|
||||||
) {
|
|
||||||
setHostRating(0);
|
setHostRating(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -131,6 +131,13 @@ export const SuccessfulPrompt = ({
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
{tokenError && (
|
||||||
|
<Grid sx={{ marginBottom: 1 }}>
|
||||||
|
<Alert severity='error' sx={{ marginTop: 2 }}>
|
||||||
|
{t("Error obatining coordinator' s token.")}
|
||||||
|
</Alert>
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Rating
|
<Rating
|
||||||
disabled={settings.connection !== 'nostr'}
|
disabled={settings.connection !== 'nostr'}
|
||||||
|
Reference in New Issue
Block a user