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;
|
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() {
|
get backupWriteStatus() {
|
||||||
const keyBackup = this._session.keyBackup.get();
|
const keyBackup = this._session.keyBackup.get();
|
||||||
if (!keyBackup) {
|
if (!keyBackup) {
|
||||||
|
@ -15,9 +15,10 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {TemplateView} from "../../general/TemplateView";
|
import {TemplateView} from "../../general/TemplateView";
|
||||||
|
import {disableTargetCallback} from "../../general/utils";
|
||||||
|
|
||||||
export class KeyBackupSettingsView extends TemplateView {
|
export class KeyBackupSettingsView extends TemplateView {
|
||||||
render(t) {
|
render(t, vm) {
|
||||||
return t.div([
|
return t.div([
|
||||||
t.map(vm => vm.status, (status, t, vm) => {
|
t.map(vm => vm.status, (status, t, vm) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
@ -56,7 +57,15 @@ export class KeyBackupSettingsView extends TemplateView {
|
|||||||
}),
|
}),
|
||||||
t.if(vm => vm.isMasterKeyTrusted, t => {
|
t.if(vm => vm.isMasterKeyTrusted, t => {
|
||||||
return t.p("Cross-signing master key found and trusted.")
|
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