-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP - Redesign #516
WIP - Redesign #516
Changes from all commits
9212def
2aa19c0
7658afd
8597f71
fbd9f14
7c78e20
ff1e5a8
27f61f0
009518c
d3cbd8b
0ca2b88
1faee58
a096ff1
78b1b85
08faf60
92078bf
7b30691
12f9966
f1e53ae
9640025
3ff25b4
43fa89e
0c0cc73
aee2b15
2b12b62
2b1c9a6
e303695
552af06
a66c222
25e25aa
e71c31f
69a4e7a
cce74cb
dbaf577
c216d15
b26a60f
8ffd479
b7e2db6
d2eb903
ea17e3e
dd60b71
cceeaa0
1de62bc
3be8842
26d31c6
eb1710d
232ba2d
ed08abb
12382a0
d14e41e
b7248af
49c13a0
c9ecea0
bedb9bc
6905ed9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
out/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
debug.log | ||
node_modules | ||
build | ||
release | ||
npm-debug.log | ||
app.log | ||
package-lock.json | ||
out | ||
*.log |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const PAGES = { | ||
FILES: 'files', | ||
INFO: 'info' | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {dialog} from 'electron' | ||
import uploadFiles from './upload-files' | ||
|
||
export default function openFileDialog (window, ipfs, dir = false) { | ||
return (event, callback) => { | ||
dialog.showOpenDialog(window, { | ||
properties: [dir ? 'openDirectory' : 'openFile', 'multiSelections'] | ||
}, (files) => { | ||
if (!files || files.length === 0) return | ||
uploadFiles(ipfs, event, files) | ||
}) | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {shell} from 'electron' | ||
import {apiAddrToUrl} from './utils' | ||
import {logger} from '../config' | ||
|
||
export default function openWebUI (ipfs, cb) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, always please use |
||
ipfs().config.get('Addresses.API') | ||
.then((res) => { | ||
shell.openExternal(apiAddrToUrl(res)) | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick, you can reduce this to just one line: |
||
.catch(logger.error) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {logger, fileHistory} from '../config' | ||
import {clipboard} from 'electron' | ||
|
||
export default function uploadFiles (ipfs, event, files) { | ||
ipfs() | ||
.add(files, {recursive: true, w: files.length > 1}) | ||
.then((res) => { | ||
logger.info('Uploading files', {files}) | ||
|
||
res.forEach((file) => { | ||
const url = `https://ipfs.io/ipfs/${file.hash}` | ||
clipboard.writeText(url) | ||
logger.info('Uploaded file', {path: file.path}) | ||
fileHistory.add(file.path, file.hash) | ||
}) | ||
}) | ||
.catch(logger.error) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should use fs.existsSync instead of trying to catch for errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done :)