forked from mystiq/hydrogen-web
Run binding when isLoading changes
This commit is contained in:
parent
4a62cdb8fb
commit
8e2838264f
2 changed files with 5 additions and 3 deletions
|
@ -38,6 +38,7 @@ export class GapTile extends SimpleTile {
|
|||
} catch (err) {
|
||||
console.error(`room.fillGap(): ${err.message}:\n${err.stack}`);
|
||||
this._error = err;
|
||||
this._loading = false;
|
||||
this.emitChange("error");
|
||||
if (err instanceof ConnectionError) {
|
||||
/*
|
||||
|
|
|
@ -30,16 +30,17 @@ export class GapView extends TemplateView {
|
|||
isAtTop: vm => vm.isAtTop,
|
||||
};
|
||||
return t.li({ className }, [
|
||||
t.map(vm => vm.error,
|
||||
(error, t, vm) => {
|
||||
t.map(vm => vm.isLoading,
|
||||
(isLoading, t, vm) => {
|
||||
let elements;
|
||||
const error = vm.error;
|
||||
if (error) {
|
||||
elements = [t.strong(() => error.message)];
|
||||
if (error.showSpinner) {
|
||||
elements.unshift(spinner(t));
|
||||
}
|
||||
}
|
||||
else if (vm.isLoading) {
|
||||
else if (isLoading) {
|
||||
elements = [spinner(t), t.span(vm.i18n`Loading more messages …`)];
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue