fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedserver',
|
||||
version: '2.0.35',
|
||||
version: '2.0.36',
|
||||
description: 'easy serving of static files'
|
||||
}
|
||||
|
@ -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!`)
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user