Display a little message while trying to redirect
This commit is contained in:
parent
b239f49580
commit
c26b8dcec1
3 changed files with 38 additions and 4 deletions
20
css/open.css
20
css/open.css
|
@ -50,3 +50,23 @@ limitations under the License.
|
|||
border-bottom: 1px solid var(--grey);
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
.OpeningClientView {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.OpeningClientView .defaultAvatar {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
background-image: url('../images/chat-icon.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 85%;
|
||||
}
|
||||
|
||||
.OpeningClientView .spinner {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
|
|
@ -22,14 +22,28 @@ import {ServerConsentView} from "./ServerConsentView.js";
|
|||
export class OpenLinkView extends TemplateView {
|
||||
render(t, vm) {
|
||||
return t.div({className: "OpenLinkView card"}, [
|
||||
t.mapView(vm => vm.previewViewModel, previewVM => previewVM ?
|
||||
new ShowLinkView(vm) :
|
||||
new ServerConsentView(vm.serverConsentViewModel)
|
||||
t.map(vm => vm.tryingLink, tryingLink => tryingLink ?
|
||||
t.view(new TryingLinkView(vm)) :
|
||||
t.mapView(vm => vm.previewViewModel, previewVM => previewVM ?
|
||||
new ShowLinkView(vm) :
|
||||
new ServerConsentView(vm.serverConsentViewModel)
|
||||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class TryingLinkView extends TemplateView {
|
||||
render (t, vm) {
|
||||
return t.div({ className: "OpeningClientView" }, [
|
||||
t.div({className: "defaultAvatar"}),
|
||||
t.h1("Trying to open your default client..."),
|
||||
t.span("If this doesn't work, you will be redirected shortly."),
|
||||
t.div({className: "spinner"}),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class ShowLinkView extends TemplateView {
|
||||
render(t, vm) {
|
||||
return t.div([
|
||||
|
|
|
@ -48,7 +48,7 @@ export class OpenLinkViewModel extends ViewModel {
|
|||
setTimeout(() => {
|
||||
this.tryingLink = false;
|
||||
this.emitChange();
|
||||
}, 5000);
|
||||
}, 1000);
|
||||
this.openLink(matrixUrl);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue