Added page for Experimental features, with NIP-26 support.
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
KINDS,
|
||||
humanPermission,
|
||||
validateKey,
|
||||
feature,
|
||||
} from './utils';
|
||||
|
||||
const log = console.log;
|
||||
@@ -36,6 +37,7 @@ Alpine.data('options', () => ({
|
||||
host: '',
|
||||
permHosts: [],
|
||||
hostPerms: [],
|
||||
delegationActive: false,
|
||||
setPermission,
|
||||
|
||||
async init(watch = true) {
|
||||
@@ -63,7 +65,10 @@ Alpine.data('options', () => ({
|
||||
// on init to set the correct profile.
|
||||
await this.getProfileNames();
|
||||
await this.getProfileIndex();
|
||||
this.setProfileIndexFromSearch();
|
||||
await this.refreshProfile();
|
||||
|
||||
this.delegationActive = await feature('delegation');
|
||||
},
|
||||
|
||||
async refreshProfile() {
|
||||
@@ -77,6 +82,15 @@ Alpine.data('options', () => ({
|
||||
|
||||
// Profile functions
|
||||
|
||||
setProfileIndexFromSearch() {
|
||||
let p = new URLSearchParams(window.location.search);
|
||||
let index = p.get('index');
|
||||
if (!index) {
|
||||
return;
|
||||
}
|
||||
this.profileIndex = parseInt(index);
|
||||
},
|
||||
|
||||
async getProfileNames() {
|
||||
this.profileNames = await getProfileNames();
|
||||
},
|
||||
@@ -98,6 +112,10 @@ Alpine.data('options', () => ({
|
||||
this.profileIndex = newIndex;
|
||||
},
|
||||
|
||||
newDelegated() {
|
||||
window.location = browser.runtime.getURL('delegation_wizard.html');
|
||||
},
|
||||
|
||||
async deleteProfile() {
|
||||
if (
|
||||
confirm(
|
||||
|
||||
Reference in New Issue
Block a user