chore(relay-angular-chat): bump js-waku to 0.27.0

This commit is contained in:
fryorcraken.eth 2022-09-14 22:36:00 +10:00
parent bc32c736c1
commit f0c85a483e
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
4 changed files with 132 additions and 473 deletions

View File

@ -21,12 +21,15 @@
"@angular/platform-browser": "~14.2.0",
"@angular/platform-browser-dynamic": "~14.2.0",
"@angular/router": "~14.2.0",
"js-waku": "0.24.0-f52dd9e",
"js-waku": "0.27.0",
"protobufjs": "^7.1.0",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.8"
},
"browser": {
"util": false
},
"devDependencies": {
"@angular-devkit/build-angular": "~14.2.1",
"@angular/cli": "~14.2.1",

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
import { Component, OnInit } from "@angular/core";
import { WakuService } from "../waku.service";
import { Waku, WakuMessage } from "js-waku";
import { WakuMessage } from "js-waku";
import type { WakuPrivacy } from "js-waku/lib/interfaces";
import protobuf from "protobufjs";
const ProtoChatMessage = new protobuf.Type("ChatMessage")
@ -21,7 +22,7 @@ export class MessagesComponent implements OnInit {
contentTopic: string = `/relay-angular-chat/1/chat/proto`;
messages: MessageInterface[] = [];
messageCount: number = 0;
waku!: Waku;
waku!: WakuPrivacy;
wakuStatus!: string;
constructor(private wakuService: WakuService) {}

View File

@ -1,14 +1,14 @@
import { Injectable } from "@angular/core";
import { Waku } from "js-waku";
import { BehaviorSubject, Subject } from "rxjs";
import { createWaku } from "js-waku/lib/create_waku";
import { createPrivacyNode } from "js-waku/lib/create_waku";
import { waitForRemotePeer } from "js-waku/lib/wait_for_remote_peer";
import type { WakuPrivacy } from "js-waku/lib/interfaces.js";
@Injectable({
providedIn: "root",
})
export class WakuService {
private wakuSubject = new Subject<Waku>();
private wakuSubject = new Subject<WakuPrivacy>();
public waku = this.wakuSubject.asObservable();
private wakuStatusSubject = new BehaviorSubject("");
@ -17,7 +17,7 @@ export class WakuService {
constructor() {}
init() {
createWaku({ defaultBootstrap: true }).then((waku) => {
createPrivacyNode({ defaultBootstrap: true }).then((waku) => {
waku.start().then(() => {
this.wakuSubject.next(waku);
this.wakuStatusSubject.next("Connecting...");