Merge branch 'main' of github.com:usebruno/bruno

This commit is contained in:
Anoop M D 2023-10-14 01:01:31 +05:30
commit 102f7a5ecb
4 changed files with 9 additions and 3 deletions

View File

@ -17,7 +17,7 @@ const ResponseLoadingOverlay = ({ item, collection }) => {
<div className="overlay">
<div style={{ marginBottom: 15, fontSize: 26 }}>
<div style={{ display: 'inline-block', fontSize: 20, marginLeft: 5, marginRight: 5 }}>
<StopWatch />
<StopWatch requestTimestamp={item?.requestSent?.timestamp} />
</div>
</div>
<IconRefresh size={24} className="loading-icon" />

View File

@ -6,6 +6,7 @@ const Wrapper = styled.div`
align-self: stretch;
align-items: center;
min-width: 34px;
flex-shrink: 0;
span {
position: relative;

View File

@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
const StopWatch = () => {
const StopWatch = ({ requestTimestamp }) => {
const [milliseconds, setMilliseconds] = useState(0);
const tickInterval = 200;
@ -15,6 +15,10 @@ const StopWatch = () => {
};
});
useEffect(() => {
setMilliseconds(Date.now() - requestTimestamp);
}, [requestTimestamp]);
if (milliseconds < 1000) {
return 'Loading...';
}

View File

@ -195,7 +195,8 @@ const registerNetworkIpc = (mainWindow) => {
url: request.url,
method: request.method,
headers: request.headers,
data: safeParseJSON(safeStringifyJSON(request.data))
data: safeParseJSON(safeStringifyJSON(request.data)),
timestamp: Date.now()
},
collectionUid,
itemUid: item.uid,