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": "~14.2.0",
"@angular/platform-browser-dynamic": "~14.2.0", "@angular/platform-browser-dynamic": "~14.2.0",
"@angular/router": "~14.2.0", "@angular/router": "~14.2.0",
"js-waku": "0.24.0-f52dd9e", "js-waku": "0.27.0",
"protobufjs": "^7.1.0", "protobufjs": "^7.1.0",
"rxjs": "~7.5.0", "rxjs": "~7.5.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"zone.js": "~0.11.8" "zone.js": "~0.11.8"
}, },
"browser": {
"util": false
},
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~14.2.1", "@angular-devkit/build-angular": "~14.2.1",
"@angular/cli": "~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 { Component, OnInit } from "@angular/core";
import { WakuService } from "../waku.service"; 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"; import protobuf from "protobufjs";
const ProtoChatMessage = new protobuf.Type("ChatMessage") const ProtoChatMessage = new protobuf.Type("ChatMessage")
@ -21,7 +22,7 @@ export class MessagesComponent implements OnInit {
contentTopic: string = `/relay-angular-chat/1/chat/proto`; contentTopic: string = `/relay-angular-chat/1/chat/proto`;
messages: MessageInterface[] = []; messages: MessageInterface[] = [];
messageCount: number = 0; messageCount: number = 0;
waku!: Waku; waku!: WakuPrivacy;
wakuStatus!: string; wakuStatus!: string;
constructor(private wakuService: WakuService) {} constructor(private wakuService: WakuService) {}

View File

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