mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-02 07:31:38 +01:00
expose self-signing in settings UI
This commit is contained in:
parent
088fcdc77b
commit
c7a2b4dc2e
@ -92,6 +92,18 @@ export class KeyBackupViewModel extends ViewModel {
|
||||
return this._session.crossSigning?.isMasterKeyTrusted ?? false;
|
||||
}
|
||||
|
||||
get canSignOwnDevice() {
|
||||
return !!this._session.crossSigning;
|
||||
}
|
||||
|
||||
async signOwnDevice() {
|
||||
if (this._session.crossSigning) {
|
||||
await this.logger.run("KeyBackupViewModel.signOwnDevice", async log => {
|
||||
await this._session.crossSigning.signOwnDevice(log);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
get backupWriteStatus() {
|
||||
const keyBackup = this._session.keyBackup.get();
|
||||
if (!keyBackup) {
|
||||
|
@ -15,9 +15,10 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import {TemplateView} from "../../general/TemplateView";
|
||||
import {disableTargetCallback} from "../../general/utils";
|
||||
|
||||
export class KeyBackupSettingsView extends TemplateView {
|
||||
render(t) {
|
||||
render(t, vm) {
|
||||
return t.div([
|
||||
t.map(vm => vm.status, (status, t, vm) => {
|
||||
switch (status) {
|
||||
@ -56,7 +57,15 @@ export class KeyBackupSettingsView extends TemplateView {
|
||||
}),
|
||||
t.if(vm => vm.isMasterKeyTrusted, t => {
|
||||
return t.p("Cross-signing master key found and trusted.")
|
||||
}),
|
||||
t.if(vm => vm.canSignOwnDevice, t => {
|
||||
return t.button({
|
||||
onClick: disableTargetCallback(async evt => {
|
||||
await vm.signOwnDevice();
|
||||
})
|
||||
}, "Sign own device");
|
||||
}),
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user