Put logic into VM

This commit is contained in:
RMidhunSuresh 2022-08-19 11:55:23 +05:30
parent 98bd8cd624
commit e6f43d6f4f
2 changed files with 13 additions and 11 deletions

View File

@ -143,6 +143,18 @@ export class GapTile extends SimpleTile {
} }
return null; return null;
} }
get currentAction() {
if (this.error) {
return this.error;
}
else if (this.isLoading) {
return "Loading";
}
else {
return "Not Loading";
}
}
} }
import {FragmentBoundaryEntry} from "../../../../../matrix/room/timeline/entries/FragmentBoundaryEntry.js"; import {FragmentBoundaryEntry} from "../../../../../matrix/room/timeline/entries/FragmentBoundaryEntry.js";

View File

@ -31,17 +31,7 @@ export class GapView extends TemplateView {
}; };
return t.li({ className }, [ return t.li({ className }, [
t.if(vm => vm.showSpinner, (t) => spinner(t)), t.if(vm => vm.showSpinner, (t) => spinner(t)),
t.span(vm => { t.span(vm => vm.currentAction)
if (vm.error) {
return vm.error;
}
else if (vm.isLoading) {
return "Loading";
}
else {
return "Not Loading";
}
})
]); ]);
} }