-
Notifications
You must be signed in to change notification settings - Fork 859
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support for js-ipfs and external nodes (#651)
* feat: support external and embedded nodes * feat: better logging and refactoring License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> * refactor: async/await instead of promises License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> * fix: correct logger path License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> * fix: store migration from v1 to v2 License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> * fix: enable web security License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> * fix: settings page working again License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> * fix: correct key sizes on welcome screen License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> * fix: work with API License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> * verify if folder is empty License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
- Loading branch information
Showing
30 changed files
with
786 additions
and
727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
const AutoLaunch = require('auto-launch') | ||
import AutoLaunch from 'auto-launch' | ||
import { store, logger } from '../../utils' | ||
|
||
const settingsOption = 'autoLaunch' | ||
const autoLauncher = new AutoLaunch({ | ||
name: 'IPFS Desktop' | ||
}) | ||
|
||
export default function (opts) { | ||
let {debug, settingsStore} = opts | ||
|
||
let activate = (value, oldValue) => { | ||
export default function () { | ||
let activate = async (value, oldValue) => { | ||
if (value === oldValue) return | ||
|
||
if (value === true) { | ||
autoLauncher.enable() | ||
.then(() => { debug('Launch on startup enabled') }) | ||
.catch(e => { debug(e.stack) }) | ||
} else { | ||
autoLauncher.disable() | ||
.then(() => { debug('Launch on startup disabled') }) | ||
.catch(e => { debug(e.stack) }) | ||
try { | ||
if (value === true) { | ||
await autoLauncher.enable() | ||
logger.info('Launch on startup enabled') | ||
} else { | ||
await autoLauncher.disable() | ||
logger.info('Launch on startup disabled') | ||
} | ||
} catch (e) { | ||
logger.error(e.stack) | ||
} | ||
} | ||
|
||
activate(settingsStore.get(settingsOption)) | ||
settingsStore.on(settingsOption, activate) | ||
activate(store.get(settingsOption)) | ||
store.onDidChange(settingsOption, activate) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.