Skip to content

Commit 118e941

Browse files
committed
fixed database connection issue
1 parent ae2e7be commit 118e941

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

app/context/ApplicationContext.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const ApplicationContextProvider: React.FC = ({ children }) => {
2020
* Connect to database provided by user at 'index'
2121
*/
2222
const connectToDB = async (index: number, application: string) => {
23+
ipcRenderer.removeAllListeners('databaseConnected');
2324
await ipcRenderer.send('connect', index);
2425
console.log(`${__dirname}/ApplicationContext.tsx/connectToDB: ** between connect & servicesRequest`);
2526

@@ -32,7 +33,6 @@ const ApplicationContextProvider: React.FC = ({ children }) => {
3233

3334
fetchServicesNames(application);
3435
});
35-
3636
};
3737

3838
/**
@@ -51,6 +51,7 @@ const ApplicationContextProvider: React.FC = ({ children }) => {
5151

5252
// Set local state
5353
setServicesData(result);
54+
ipcRenderer.removeAllListeners('servicesResponse');
5455
});
5556
};
5657

app/modals/ServicesModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ServicesModal: React.SFC<ServicesModalProps> = ({ i, app }) => {
3636
* fetch request for service names
3737
*/
3838
const fetchStuff = () => {
39-
fetchServicesNames(app);
39+
// fetchServicesNames(app);
4040
};
4141

4242
return (

0 commit comments

Comments
 (0)