mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
show session load view when picking a session
This commit is contained in:
parent
3dde23fc4b
commit
225fe873be
@ -1,6 +1,6 @@
|
||||
import {TemplateView} from "../general/TemplateView.js";
|
||||
import {brawlGithubLink} from "./common.js";
|
||||
import {spinner} from "../common.js";
|
||||
import {SessionLoadView} from "./SessionLoadView.js";
|
||||
|
||||
export class LoginView extends TemplateView {
|
||||
render(t, vm) {
|
||||
@ -25,11 +25,3 @@ export class LoginView extends TemplateView {
|
||||
}
|
||||
}
|
||||
|
||||
class SessionLoadView extends TemplateView {
|
||||
render(t) {
|
||||
return t.div({className: "SessionLoadView"}, [
|
||||
spinner(t, {hidden: vm => !vm.loading}),
|
||||
t.p(vm => vm.loadLabel)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
11
src/ui/web/login/SessionLoadView.js
Normal file
11
src/ui/web/login/SessionLoadView.js
Normal file
@ -0,0 +1,11 @@
|
||||
import {TemplateView} from "../general/TemplateView.js";
|
||||
import {spinner} from "../common.js";
|
||||
|
||||
export class SessionLoadView extends TemplateView {
|
||||
render(t) {
|
||||
return t.div({className: "SessionLoadView"}, [
|
||||
spinner(t, {hidden: vm => !vm.loading}),
|
||||
t.p(vm => vm.loadLabel)
|
||||
]);
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
import {ListView} from "../general/ListView.js";
|
||||
import {TemplateView} from "../general/TemplateView.js";
|
||||
import {brawlGithubLink} from "./common.js";
|
||||
import {SessionLoadView} from "./SessionLoadView.js";
|
||||
|
||||
function selectFileAsText(mimeType) {
|
||||
const input = document.createElement("input");
|
||||
@ -85,6 +86,7 @@ export class SessionPickerView extends TemplateView {
|
||||
t.view(sessionList),
|
||||
t.p(t.button({onClick: () => vm.cancel()}, ["Log in to a new session instead"])),
|
||||
t.p(t.button({onClick: async () => vm.import(await selectFileAsText("application/json"))}, "Import")),
|
||||
t.if(vm => vm.loadViewModel, vm => new SessionLoadView(vm.loadViewModel)),
|
||||
t.p(brawlGithubLink(t))
|
||||
]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user