diff --git a/package-lock.json b/package-lock.json index 70d7cb0..e20cef2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "sass": "^1.54.3", "secure-file-transfer": "^0.0.7", "streamsaver": "^2.0.6", - "trystero": "github:jeremyckahn/trystero#bugfix/29__clean-up-peers", + "trystero": "^0.12.0", "typeface-public-sans": "^1.1.13", "typeface-roboto": "^1.1.13", "typescript": "^4.7.4", @@ -25064,9 +25064,9 @@ "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==" }, "node_modules/trystero": { - "version": "0.11.7", - "resolved": "git+ssh://git@github.com/jeremyckahn/trystero.git#65ca75baac7a9df40fd217c6533dea2b059a15e7", - "license": "MIT", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/trystero/-/trystero-0.12.0.tgz", + "integrity": "sha512-iIN/4Ixg+s3CUiCLKQkU/XbdwNSUSzO4PwXzT74iiSlSDqclpm1Ra9fjPBsYH4vIPXTNgbZ+eCJIMKspbflgvA==", "dependencies": { "firebase": "^9.6.5", "ipfs-core": "0.9.0", @@ -45158,8 +45158,9 @@ "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==" }, "trystero": { - "version": "git+ssh://git@github.com/jeremyckahn/trystero.git#65ca75baac7a9df40fd217c6533dea2b059a15e7", - "from": "trystero@github:jeremyckahn/trystero#bugfix/29__clean-up-peers", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/trystero/-/trystero-0.12.0.tgz", + "integrity": "sha512-iIN/4Ixg+s3CUiCLKQkU/XbdwNSUSzO4PwXzT74iiSlSDqclpm1Ra9fjPBsYH4vIPXTNgbZ+eCJIMKspbflgvA==", "requires": { "firebase": "^9.6.5", "ipfs-core": "0.9.0", diff --git a/package.json b/package.json index 0ec2f9e..565f4e8 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "sass": "^1.54.3", "secure-file-transfer": "^0.0.7", "streamsaver": "^2.0.6", - "trystero": "github:jeremyckahn/trystero#bugfix/29__clean-up-peers", + "trystero": "^0.12.0", "typeface-public-sans": "^1.1.13", "typeface-roboto": "^1.1.13", "typescript": "^4.7.4", diff --git a/src/__mocks__/trystero.ts b/src/__mocks__/trystero.ts index 047a25c..c2e3fe9 100644 --- a/src/__mocks__/trystero.ts +++ b/src/__mocks__/trystero.ts @@ -8,7 +8,7 @@ export const joinRoom: typeof trysteroJoinRoom = ( makeAction: () => [() => Promise.resolve([]), () => {}, () => {}], ping: () => Promise.resolve(0), leave: () => {}, - getPeers: () => [], + getPeers: () => ({}), addStream: () => [Promise.resolve()], removeStream: () => {}, addTrack: () => [Promise.resolve()], diff --git a/src/services/PeerRoom/PeerRoom.ts b/src/services/PeerRoom/PeerRoom.ts index d1c13a4..98ac7ba 100644 --- a/src/services/PeerRoom/PeerRoom.ts +++ b/src/services/PeerRoom/PeerRoom.ts @@ -110,8 +110,9 @@ export class PeerRoom { this.peerStreamHandlers = new Map() } - getPeers: Room['getPeers'] = () => { - return this.room.getPeers() + getPeers = () => { + const peers = this.room.getPeers() + return Object.keys(peers) } makeAction = (namespace: string) => {