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

Commit c8aada6

Browse files
committed
WIP - Move to the new hyperdrive daemon
1 parent 6d69529 commit c8aada6

4 files changed

Lines changed: 7 additions & 30 deletions

File tree

app/background-process.js

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

8787
app.on('ready', async function () {
88-
// start the daemon process
89-
var datDaemonProcess = await childProcesses.spawn('dat-daemon', './dat-daemon.js')
90-
9188
portForwarder.setup()
9289

9390
// setup core
@@ -109,8 +106,7 @@ app.on('ready', async function () {
109106
},
110107
rpcAPI: rpc,
111108
downloadsWebAPI: downloads.WEBAPI,
112-
browserWebAPI: beakerBrowser.WEBAPI,
113-
datDaemonProcess
109+
browserWebAPI: beakerBrowser.WEBAPI
114110
})
115111

116112
// base

app/background-process/ui/permissions.js

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

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,19 +484,20 @@ class View {
484484
// live reloading
485485
// =
486486

487-
toggleLiveReloading (enable) {
487+
488+
async toggleLiveReloading (enable) {
488489
if (typeof enable === 'undefined') {
489490
enable = !this.liveReloadEvents
490491
}
491-
if (!enable) {
492+
if (this.liveReloadEvents) {
492493
this.liveReloadEvents.close()
493494
this.liveReloadEvents = false
494495
} else if (this.datInfo) {
495496
let archive = beakerCore.dat.library.getArchive(this.datInfo.key)
496497
if (!archive) return
497498

498499
let {version} = parseDatURL(this.url)
499-
let {checkoutFS} = beakerCore.dat.library.getArchiveCheckout(archive, version)
500+
let {checkoutFS} = await beakerCore.dat.library.getArchiveCheckout(archive, version)
500501
this.liveReloadEvents = checkoutFS.pda.watch()
501502

502503
let event = (this.datInfo.isOwner) ? 'changed' : 'invalidated'
@@ -629,7 +630,7 @@ class View {
629630
this.donateLinkHref = _get(this, 'datInfo.links.payment.0.href')
630631
if (this.previewMode) {
631632
let archive = beakerCore.dat.library.getArchive(key)
632-
let diff = await beakerCore.dat.library.getDaemon().fs_diffListing(archive, {compareContent: true, shallow: true})
633+
let diff = [] // TODO await beakerCore.dat.library.getDaemon().fs_diffListing(archive, {compareContent: true, shallow: true})
633634
this.uncommittedChanges = diff ? diff.length : 0
634635
}
635636
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)