Skip to content

Commit

Permalink
revert changes outside scope of PR
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Oct 26, 2023
1 parent ae35e9c commit be64a3d
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/mapeo-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ import { ProjectKeys } from './generated/keys.js'
import {
deNullify,
getDeviceId,
keyToId,
projectIdToNonce,
projectKeyToId,
projectKeyToPublicId,
} from './utils.js'
import { RandomAccessFilePool } from './core-manager/random-access-file-pool.js'
import { LocalPeers } from './local-peers.js'
import { InviteApi } from './invite-api.js'
import { LocalDiscovery } from './discovery/local-discovery.js'

/** @typedef {import("@mapeo/schema").ProjectSettingsValue} ProjectValue */

Expand All @@ -52,7 +50,6 @@ export class MapeoManager {
#deviceId
#rpc
#invite
#localDiscovery

/**
* @param {Object} opts
Expand Down Expand Up @@ -106,17 +103,6 @@ export class MapeoManager {
} else {
this.#coreStorage = coreStorage
}

this.#localDiscovery = new LocalDiscovery({
identityKeypair: this.#keyManager.getIdentityKeypair(),
})

this.#localDiscovery.on('connection', (connection) => {
this.#handleDiscoveryConnection(connection).catch((e) => {
// Ignore errors here for now
console.error('Error handling discovery connection', e)
})
})
}

/**
Expand Down Expand Up @@ -396,18 +382,6 @@ export class MapeoManager {
return projectPublicId
}

/**
* @param {import('./discovery/local-discovery.js').OpenedNoiseStream} connection
*/
async #handleDiscoveryConnection(connection) {
const peerId = keyToId(connection.remotePublicKey)
this.#rpc.connect(connection)
const { name } = await this.getDeviceInfo()
if (name) {
this.#rpc.sendDeviceInfo(peerId, { name })
}
}

/**
* @template {import('type-fest').Exact<import('./schema/client.js').DeviceInfoParam, T>} T
* @param {T} deviceInfo
Expand Down

0 comments on commit be64a3d

Please sign in to comment.