Small fixes chat

This commit is contained in:
Reckless_Satoshi 2023-05-07 11:52:31 -07:00
parent 8ae18f8b2a
commit 2293a8922d
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 5 additions and 4 deletions

View File

@ -44,7 +44,7 @@ const EncryptedSocketChat: React.FC<Props> = ({
const { t } = useTranslation();
const theme = useTheme();
const audio = new Audio(`/static/assets/sounds/chat-open.mp3`);
const [audio] = useState(() => new Audio(`/static/assets/sounds/chat-open.mp3`));
const [connected, setConnected] = useState<boolean>(false);
const [peerConnected, setPeerConnected] = useState<boolean>(false);
const [peerPubKey, setPeerPubKey] = useState<string>();

View File

@ -43,7 +43,7 @@ const EncryptedTurtleChat: React.FC<Props> = ({
const { t } = useTranslation();
const theme = useTheme();
const audio = new Audio(`/static/assets/sounds/chat-open.mp3`);
const [audio] = useState(() => new Audio(`/static/assets/sounds/chat-open.mp3`));
const [peerConnected, setPeerConnected] = useState<boolean>(false);
const [peerPubKey, setPeerPubKey] = useState<string>();
const [value, setValue] = useState<string>('');

View File

@ -294,10 +294,11 @@ export const useAppStore = () => {
};
const fetchOrder = function () {
if (currentOrder != undefined) {
if (currentOrder) {
apiClient
.get(baseUrl, '/api/order/?order_id=' + currentOrder, { tokenSHA256: robot.tokenSHA256 })
.then(orderReceived);
.then(orderReceived)
.catch(orderReceived);
}
};