Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .storybook/preview-body.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
window.mainFont;
window.codeFont;
window.isJaegerEnabled = true;
window.recentActivityRefreshInterval;
window.recentActivityExpirationLimit;
window.recentActivityDocumentationURL =
"https://github.com/digma-ai/digma-vscode-plugin#%EF%B8%8F-extension-settings";
Expand Down
1 change: 0 additions & 1 deletion assets/recentActivity/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
window.mainFont;
window.codeFont;
window.isJaegerEnabled;
window.recentActivityRefreshInterval;
window.recentActivityExpirationLimit;
window.recentActivityDocumentationURL;
</script>
Expand Down
16 changes: 2 additions & 14 deletions src/components/RecentActivity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@ const documentationURL =
? window.recentActivityDocumentationURL
: null;

const REFRESH_INTERVAL =
typeof window.recentActivityRefreshInterval === "number"
? window.recentActivityRefreshInterval
: 10 * 1000; // in milliseconds

const ACTION_PREFIX = "RECENT_ACTIVITY";

const actions = addPrefix(ACTION_PREFIX, {
GET_DATA: "GET_DATA",
INITIALIZE: "INITIALIZE",
SET_DATA: "SET_DATA",
GO_TO_SPAN: "GO_TO_SPAN",
GO_TO_TRACE: "GO_TO_TRACE"
Expand Down Expand Up @@ -73,13 +68,8 @@ export const RecentActivity = (props: RecentActivityProps) => {

useEffect(() => {
window.sendMessageToDigma({
action: actions.GET_DATA
action: actions.INITIALIZE
});
const refreshInterval = setInterval(() => {
window.sendMessageToDigma({
action: actions.GET_DATA
});
}, REFRESH_INTERVAL);

const handleRecentActivityData = (data: unknown) => {
setData(data as RecentActivityData);
Expand All @@ -96,8 +86,6 @@ export const RecentActivity = (props: RecentActivityProps) => {
);

return () => {
clearInterval(refreshInterval);

dispatcher.removeActionListener(
actions.SET_DATA,
handleRecentActivityData
Expand Down
1 change: 0 additions & 1 deletion src/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ declare global {
mainFont?: unknown;
codeFont?: unknown;
isJaegerEnabled?: unknown;
recentActivityRefreshInterval?: unknown;
recentActivityExpirationLimit?: unknown;
recentActivityDocumentationURL?: unknown;
wizardSkipInstallationStep?: unknown;
Expand Down