Skip to content

The getIntegrations function runs repeatedly due to state polling #1

@pumfleet

Description

@pumfleet

Within the pages/integrations.tsx page, the getIntegrations() function is called repeatedly, most likely due to the integration data using state, hence it is re-fetching the data constantly as the state refreshes.

Here's the problematic code:

const [integrations, setIntegrations] = useState([]);

function getIntegrations() {
        fetch('/api/integrations')
            .then((response) => response.json())
            .then((data) => setIntegrations(data));
}

// TODO: Stop this function from running repeatedly
getIntegrations()

Metadata

Metadata

Assignees

Labels

🐛 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions