Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 80bcc39

Browse files
committed
WIP - Move to the new hyperdrive daemon
1 parent 0bdf691 commit 80bcc39

4 files changed

Lines changed: 5 additions & 29 deletions

File tree

app/background-process.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ app.on('open-file', (e, filepath) => {
8181
})
8282

8383
app.on('ready', async function () {
84-
// start the daemon process
85-
var datDaemonProcess = await childProcesses.spawn('dat-daemon', './dat-daemon.js')
86-
8784
portForwarder.setup()
8885

8986
// setup core
@@ -105,8 +102,7 @@ app.on('ready', async function () {
105102
},
106103
rpcAPI: rpc,
107104
downloadsWebAPI: downloads.WEBAPI,
108-
browserWebAPI: beakerBrowser.WEBAPI,
109-
datDaemonProcess
105+
browserWebAPI: beakerBrowser.WEBAPI
110106
})
111107

112108
// base

app/background-process/ui/permissions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function checkLabsPerm ({perm, labApi, apiDocsUrl, sender}) {
7777
let isOptedIn = false
7878
let archive = dat.library.getArchive(key)
7979
if (archive) {
80-
let {checkoutFS} = dat.library.getArchiveCheckout(archive, urlp.version)
80+
let {checkoutFS} = await dat.library.getArchiveCheckout(archive, urlp.version)
8181
let manifest = await pda.readManifest(checkoutFS).catch(_ => {})
8282
let apis = _get(manifest, 'experimental.apis')
8383
if (apis && Array.isArray(apis)) {

app/background-process/ui/view-manager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ class View {
438438
// live reloading
439439
// =
440440

441-
toggleLiveReloading () {
441+
async toggleLiveReloading () {
442442
if (this.liveReloadEvents) {
443443
this.liveReloadEvents.close()
444444
this.liveReloadEvents = false
@@ -447,7 +447,7 @@ class View {
447447
if (!archive) return
448448

449449
let {version} = parseDatURL(this.url)
450-
let {checkoutFS} = beakerCore.dat.library.getArchiveCheckout(archive, version)
450+
let {checkoutFS} = await beakerCore.dat.library.getArchiveCheckout(archive, version)
451451
this.liveReloadEvents = checkoutFS.pda.watch()
452452

453453
let event = (this.datInfo.isOwner) ? 'changed' : 'invalidated'
@@ -605,7 +605,7 @@ class View {
605605
this.donateLinkHref = _get(this, 'datInfo.links.payment.0.href')
606606
if (this.previewMode) {
607607
let archive = beakerCore.dat.library.getArchive(key)
608-
let diff = await beakerCore.dat.library.getDaemon().fs_diffListing(archive, {compareContent: true, shallow: true})
608+
let diff = [] // TODO await beakerCore.dat.library.getDaemon().fs_diffListing(archive, {compareContent: true, shallow: true})
609609
this.uncommittedChanges = diff ? diff.length : 0
610610
}
611611
let userSession = getUserSessionFor(this.browserWindow.webContents)

app/dat-daemon.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)