fix(core): update

This commit is contained in:
2023-03-29 19:51:52 +02:00
parent 08463a7599
commit 59d6c7d5ec
6 changed files with 34 additions and 19 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@apiglobal/typedserver',
version: '2.0.35',
version: '2.0.36',
description: 'easy serving of static files'
}

View File

@ -98,7 +98,17 @@ export class ReloadChecker {
this.typedrouter,
plugins.typedsocket.TypedSocket.useWindowLocationOriginUrl()
);
this.typedsocket;
this.typedsocket.eventSubject.subscribe(eventArg => {
console.log(`typedsocket event subscription: ${eventArg}`);
if (eventArg === 'disconnected' || eventArg === 'disconnecting' || eventArg === 'timedOut') {
this.backendConnectionLost = true;
this.infoscreen.setText(`typedsocket ${eventArg}!`)
} else if (eventArg === 'connected' && this.backendConnectionLost) {
this.backendConnectionLost = false;
this.infoscreen.setSuccess('typedsocket connected!')
}
});
logger.log('success', `ReloadChecker connected through typedsocket!`)
}
}

View File

@ -71,6 +71,7 @@ export class TypedserverInfoscreen extends LitElement {
];
public setText(textArg: string) {
this.success = false;
this.text = textArg;
this.show();
this.success = false;
@ -80,17 +81,23 @@ export class TypedserverInfoscreen extends LitElement {
this.text = textArg;
this.show();
this.success = true;
setTimeout(() => this.hide(), 1000);
}
private appended = false;
public show () {
this.appended = true;
public async show () {
document.body.append(this);
this.appended = true;
await plugins.smartdelay.delayFor(0);
const mainbox = this.shadowRoot.querySelector('.mainbox');
mainbox.classList.add('show');
}
public hide() {
this.success = false;
public async hide() {
this.text = '';
const mainbox = this.shadowRoot.querySelector('.mainbox');
mainbox.classList.add('show');
await plugins.smartdelay.delayFor(300);
if (this.appended) {
document.body.removeChild(this);
}
@ -99,7 +106,7 @@ export class TypedserverInfoscreen extends LitElement {
public render () {
return html`
<div class="mainbox ${this.show ? 'show' : ''} ${this.success ? 'success': ''}">${this.text}</div>
<div class="mainbox ${this.success ? 'success': ''}">${this.text}</div>
`
}