-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWorkspaces.js
More file actions
42 lines (35 loc) · 1.05 KB
/
Workspaces.js
File metadata and controls
42 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { ipcRenderer } from "electron";
import {
SET_WORKSPACES,
SET_CURRENT_WORKSPACE,
CONTRACT_DEPLOYED,
CONTRACT_TRANSACTION,
CONTRACT_EVENT,
PROJECT_UPDATED,
setWorkspaces,
setCurrentWorkspace,
contractDeployed,
contractTransaction,
contractEvent,
projectUpdated,
} from "../../common/redux/workspaces/actions";
export function initWorkspaces(store) {
ipcRenderer.on(SET_WORKSPACES, (event, workspaceNames) => {
store.dispatch(setWorkspaces(workspaceNames));
});
ipcRenderer.on(SET_CURRENT_WORKSPACE, (event, workspace, contractCache) => {
store.dispatch(setCurrentWorkspace(workspace, contractCache));
});
ipcRenderer.on(CONTRACT_DEPLOYED, (event, data) => {
store.dispatch(contractDeployed(data));
});
ipcRenderer.on(CONTRACT_TRANSACTION, (event, data) => {
store.dispatch(contractTransaction(data));
});
ipcRenderer.on(CONTRACT_EVENT, (event, data) => {
store.dispatch(contractEvent(data));
});
ipcRenderer.on(PROJECT_UPDATED, (event, data) => {
store.dispatch(projectUpdated(data));
});
}