mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
Fix bug
The verification panel would only render correctly once. This was due to a race in the right panel navigation code.
This commit is contained in:
parent
08398b064a
commit
82502e3bb1
@ -77,14 +77,17 @@ export class RightPanelViewModel extends ViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
_hookUpdaterToSegment(segment, viewmodel, argCreator, failCallback) {
|
||||
async _hookUpdaterToSegment(segment, ViewModel, argCreator, failCallback) {
|
||||
const observable = this.navigation.observe(segment);
|
||||
const updater = this._setupUpdater(segment, viewmodel, argCreator, failCallback);
|
||||
const updater = await this._setupUpdater(segment, ViewModel, argCreator, failCallback);
|
||||
this.track(observable.subscribe(updater));
|
||||
}
|
||||
|
||||
_setupUpdater(segment, viewmodel, argCreator, failCallback) {
|
||||
async _setupUpdater(segment, ViewModel, argCreator, failCallback) {
|
||||
const updater = async (skipDispose = false) => {
|
||||
if (this._activeViewModel instanceof ViewModel) {
|
||||
return;
|
||||
}
|
||||
if (!skipDispose) {
|
||||
this._activeViewModel = this.disposeTracked(this._activeViewModel);
|
||||
}
|
||||
@ -95,11 +98,11 @@ export class RightPanelViewModel extends ViewModel {
|
||||
failCallback();
|
||||
return;
|
||||
}
|
||||
this._activeViewModel = this.track(new viewmodel(this.childOptions(args)));
|
||||
this._activeViewModel = this.track(new ViewModel(this.childOptions(args)));
|
||||
}
|
||||
this.emitChange("activeViewModel");
|
||||
};
|
||||
updater(true);
|
||||
await updater(true);
|
||||
return updater;
|
||||
}
|
||||
|
||||
|
@ -183,6 +183,7 @@ export class RoomChannel extends Disposables implements IChannel {
|
||||
|
||||
async cancelVerification(cancellationType: CancelReason) {
|
||||
await this.log.wrap("RoomChannel.cancelVerification", async log => {
|
||||
log.log({ reason: messageFromErrorType[cancellationType] });
|
||||
if (this.isCancelled) {
|
||||
throw new VerificationCancelledError();
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class ButtonsView extends TemplateView {
|
||||
className: {
|
||||
"back": true,
|
||||
"button-utility": true,
|
||||
"hide": !vm.activeViewModel.shouldShowBackButton
|
||||
"hide": (vm) => !vm.activeViewModel.shouldShowBackButton
|
||||
}, onClick: () => vm.showPreviousPanel()}),
|
||||
t.button({className: "close button-utility", onClick: () => vm.closePanel()})
|
||||
]);
|
||||
|
Loading…
Reference in New Issue
Block a user