Skip to content

Commit 31857a5

Browse files
committed
added ipcMain handler and fs import for importComponent
1 parent 46d58f4 commit 31857a5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src-electron/electron-main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ ipcMain.handle("exportComponent", async (event, arg) => {
7575
return result;
7676
});
7777

78+
// Handle dialogs for importing a component
79+
ipcMain.handle("importComponent", async (event, arg) => {
80+
const result = await dialog.showOpenDialog(arg);
81+
return result;
82+
});
83+
7884

7985
// ************** Slack OAuth functions **********************
8086
// Sends request to Slack for User's information,

src/components/home_sidebar_items/ComponentTab/ImportComponent.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</template>
1010

1111
<script>
12-
12+
const { fs, ipcRenderer } = window;
1313
export default {
1414
1515
methods: {
@@ -21,8 +21,8 @@ export default {
2121
//renders the open file
2222
importComponent() {
2323
ipcRenderer
24-
.invoke("openProject", {
25-
properties: ["openProject"],
24+
.invoke("importComponent", {
25+
properties: ["openFile"],
2626
filters: [
2727
{
2828
name: "Vue Files",

0 commit comments

Comments
 (0)