Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
Add file associations
Browse files Browse the repository at this point in the history
Former-commit-id: 33257f2 [formerly 33257f2 [formerly 924aa94]]
Former-commit-id: fbd60c44ce6a2cf0e92bae990552752582dae389
Former-commit-id: 4353a99
  • Loading branch information
xnerhu committed Oct 20, 2018
1 parent 086aa1a commit 4b569e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@
},
"mac": {
"category": "public.app-category.navigation"
},
"fileAssociations": {
"ext": [".html"],
"description": "Wexond",
"role": "Viewer"
}
}
11 changes: 9 additions & 2 deletions src/renderer/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { ipcRenderer } from 'electron';
import { ipcRenderer, remote } from 'electron';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import { injectGlobal } from 'styled-components';
Expand All @@ -21,14 +21,21 @@ const render = (AppComponent: any) => {
};
(async function setup() {
runServices();

render(App);

if (store.extensionsStore.defaultBrowserActions.length === 0) {
await store.extensionsStore.load();
}

if (store.tabsStore.groups.length === 0) {
const argv = remote.process.argv;

store.tabsStore.addGroup();

if (argv.length > 1 && argv[1] !== '.') {
store.tabsStore.getSelectedTab().url = argv[1];
store.pagesStore.getSelected().url = argv[1];
}
}

ipcRenderer.send('renderer-load');
Expand Down

0 comments on commit 4b569e9

Please sign in to comment.