Native app facelift, extension UI tweaks, bug fixes.
Show/Hide Button for private key in Options page. Move experimental page into separate sub-folder. Move delegation wizard to sub-folder. Move permission page into separate folder. Basic functional SwiftUI look for the app. Beginning to define the main app view. NavigationStack and Privacy Policy Show App Icon on main screen. Getting Started: macOS Getting Started: iPhone Getting Started: iPad Removing old default UIKit code. Added "No Thanks" toggle to the relay reminder. Clearly indicate in the Settings page when a profile is a delegated profile. Changed recommended relays to all public relays. Use x-cloak in all the places. Fix bundle display name to use capital N. Added copy button to pubkey in settings. Window default size. Updating event kind list. Allow events to be copied by clicking on them in the event log. Tweaking the colors for a more purple-ish look. Added Tips and Tricks view to native app. Move utilities modules into separate folder. Rename event_log files to event_history to escape some content blockers. Renamed Event Log to Event History in the UI as well.
This commit is contained in:
@@ -17,10 +17,15 @@ import {
|
||||
humanPermission,
|
||||
validateKey,
|
||||
feature,
|
||||
} from './utils';
|
||||
getDelegator,
|
||||
} from './utilities/utils';
|
||||
|
||||
const log = console.log;
|
||||
|
||||
function go(url) {
|
||||
browser.tabs.update({ url: browser.runtime.getURL(url) });
|
||||
}
|
||||
|
||||
Alpine.data('options', () => ({
|
||||
profileNames: ['---'],
|
||||
profileIndex: 0,
|
||||
@@ -38,7 +43,12 @@ Alpine.data('options', () => ({
|
||||
permHosts: [],
|
||||
hostPerms: [],
|
||||
delegationActive: false,
|
||||
visible: false,
|
||||
delegate: false,
|
||||
delegator: '',
|
||||
copied: false,
|
||||
setPermission,
|
||||
go,
|
||||
|
||||
async init(watch = true) {
|
||||
log('Initialize backend.');
|
||||
@@ -78,6 +88,7 @@ Alpine.data('options', () => ({
|
||||
await this.getNpub();
|
||||
await this.getRelays();
|
||||
await this.getPermissions();
|
||||
await this.getDelegate();
|
||||
},
|
||||
|
||||
// Profile functions
|
||||
@@ -106,6 +117,15 @@ Alpine.data('options', () => ({
|
||||
this.profileIndex = await getProfileIndex();
|
||||
},
|
||||
|
||||
async getDelegate() {
|
||||
let [delegate, delegator] = await getDelegator(this.profileIndex);
|
||||
this.delegate = delegate;
|
||||
this.delegator = await browser.runtime.sendMessage({
|
||||
kind: 'npubEncode',
|
||||
payload: delegator,
|
||||
});
|
||||
},
|
||||
|
||||
async newProfile() {
|
||||
let newIndex = await newProfile();
|
||||
await this.getProfileNames();
|
||||
@@ -113,7 +133,9 @@ Alpine.data('options', () => ({
|
||||
},
|
||||
|
||||
newDelegated() {
|
||||
window.location = browser.runtime.getURL('delegation_wizard.html');
|
||||
window.location = browser.runtime.getURL(
|
||||
'wizards/delegation/delegation.html'
|
||||
);
|
||||
},
|
||||
|
||||
async deleteProfile() {
|
||||
@@ -127,6 +149,14 @@ Alpine.data('options', () => ({
|
||||
}
|
||||
},
|
||||
|
||||
async copyPubKey() {
|
||||
await navigator.clipboard.writeText(this.pubKey);
|
||||
this.copied = true;
|
||||
setTimeout(() => {
|
||||
this.copied = false;
|
||||
}, 1500);
|
||||
},
|
||||
|
||||
// Key functions
|
||||
|
||||
async saveProfile() {
|
||||
@@ -292,6 +322,10 @@ Alpine.data('options', () => ({
|
||||
? ''
|
||||
: 'ring-2 ring-rose-500 focus:ring-2 focus:ring-rose-500 border-transparent focus:border-transparent';
|
||||
},
|
||||
|
||||
get visibilityClass() {
|
||||
return this.visible ? 'text' : 'password';
|
||||
},
|
||||
}));
|
||||
|
||||
Alpine.start();
|
||||
|
||||
Reference in New Issue
Block a user