Remove React

This commit is contained in:
2023-11-18 19:25:08 +01:00
parent 73b2d3f60b
commit cdf81ed9f4
31 changed files with 17 additions and 20467 deletions

View File

@@ -1 +0,0 @@
<p>donator-box works!</p>

View File

@@ -1,23 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DonatorBoxComponent } from './donator-box.component';
describe('DonatorBoxComponent', () => {
let component: DonatorBoxComponent;
let fixture: ComponentFixture<DonatorBoxComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [DonatorBoxComponent]
})
.compileComponents();
fixture = TestBed.createComponent(DonatorBoxComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -1,13 +0,0 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-donator-box',
standalone: true,
imports: [CommonModule],
templateUrl: './donator-box.component.html',
styleUrl: './donator-box.component.scss'
})
export class DonatorBoxComponent {
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import {Observable, Observer, Subject} from 'rxjs';
import {observable, Observable, Observer, Subject} from 'rxjs';
import { WSMessage } from '../app/models/WSMessage';
@Injectable({
providedIn: 'root',
@@ -11,6 +11,9 @@ export class WebsocketService {
public Messages: Subject<WSMessage>
trydelay = function(ms:number) { new Promise(res => setTimeout(res, ms));}
constructor() {
this.connect();
this.Messages = new Subject<WSMessage>();
@@ -20,7 +23,7 @@ export class WebsocketService {
return !this.isConnected;
}
connect(){
this.socket = new WebSocket('ws://localhost:5000/notify');
this.socket = new WebSocket('ws://localhost:5000/notify');
this.socket.onopen = () => {
this.isConnected = true;
@@ -46,5 +49,17 @@ export class WebsocketService {
console.log("Connection");
}
async reconnect(){
while(!this.isConnected){
try{
this.connect();
await this.trydelay(5000);
}
catch{
console.log("Retrying");
}
}
}
}