XL passive update
This commit is contained in:
parent
3ce7e3f01c
commit
e4fb92d49b
|
@ -1099,6 +1099,7 @@ var XenoLib = (() => {
|
||||||
this.resizeObserver.disconnect();
|
this.resizeObserver.disconnect();
|
||||||
}
|
}
|
||||||
handleDispatch(e) {
|
handleDispatch(e) {
|
||||||
|
if (this.state.leaving || this.state.closeFast) return;
|
||||||
if (e.type === 'XL_NOTIFS_SETTINGS_UPDATE') {
|
if (e.type === 'XL_NOTIFS_SETTINGS_UPDATE') {
|
||||||
if (e.key !== UPDATEKEY) return;
|
if (e.key !== UPDATEKEY) return;
|
||||||
this._animationCancel();
|
this._animationCancel();
|
||||||
|
@ -1151,6 +1152,11 @@ var XenoLib = (() => {
|
||||||
if (this.state.closeFast) return;
|
if (this.state.closeFast) return;
|
||||||
this.resizeObserver.disconnect();
|
this.resizeObserver.disconnect();
|
||||||
this._animationCancel();
|
this._animationCancel();
|
||||||
|
api.setState(state => {
|
||||||
|
const dt = state.data.find(m => m.id === this.props.id);
|
||||||
|
if (dt) dt.leaving = true;
|
||||||
|
return { data: state.data };
|
||||||
|
});
|
||||||
this.setState({ closeFast: true });
|
this.setState({ closeFast: true });
|
||||||
}
|
}
|
||||||
handleResizeEvent() {
|
handleResizeEvent() {
|
||||||
|
@ -1211,17 +1217,19 @@ var XenoLib = (() => {
|
||||||
if (this.state.progress === -1) await next({ progress: 100 });
|
if (this.state.progress === -1) await next({ progress: 100 });
|
||||||
else await next({ progress: this.state.progress });
|
else await next({ progress: this.state.progress });
|
||||||
}
|
}
|
||||||
if (this.state.progress !== 100 || !this.state.loading) return;
|
if (this.state.progress < 100 || !this.state.loading) return;
|
||||||
}
|
}
|
||||||
if (this.state.hovered && !this.state.closeFast) return;
|
if (this.state.hovered && !this.state.closeFast) return;
|
||||||
if (!this.state.closeFast && !LibrarySettings.notifications.timeoutReset) this._startProgressing = Date.now();
|
if (!this.state.closeFast && !LibrarySettings.notifications.timeoutReset) this._startProgressing = Date.now();
|
||||||
await next({ progress: 100 });
|
await next({ progress: 100 });
|
||||||
this.state.leaving = true;
|
this.state.leaving = true;
|
||||||
|
if (!this.state.closeFast) {
|
||||||
api.setState(state => {
|
api.setState(state => {
|
||||||
const dt = state.data.find(m => m.id === this.props.id);
|
const dt = state.data.find(m => m.id === this.props.id);
|
||||||
if (dt) dt.leaving = true;
|
if (dt) dt.leaving = true;
|
||||||
return { data: state.data };
|
return { data: state.data };
|
||||||
});
|
});
|
||||||
|
}
|
||||||
this.props.onLeave();
|
this.props.onLeave();
|
||||||
await next({ opacity: 0, height: 0 });
|
await next({ opacity: 0, height: 0 });
|
||||||
api.setState(state => ({ data: state.data.filter(n => n.id !== this.props.id) }));
|
api.setState(state => ({ data: state.data.filter(n => n.id !== this.props.id) }));
|
||||||
|
|
Loading…
Reference in New Issue