- Rename all gooti-* files to plebian-signer-* across Chrome and Firefox - Rename GootiMetaHandler to SignerMetaHandler in common library - Update all references to use new naming convention - Add CLAUDE.md with project build/architecture documentation - Add Claude Code release command tailored for this npm/Angular project - Add NWC-IMPLEMENTATION.md design document - Add Claude skills for nostr, typescript, react, svelte, and applesauce libs - Update README and various component templates with new branding 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
import { SignerMetaData, SignerMetaHandler } from '@common';
|
|
|
|
export class ChromeMetaHandler extends SignerMetaHandler {
|
|
async loadFullData(): Promise<Partial<Record<string, any>>> {
|
|
const dataWithPossibleAlienProperties = await chrome.storage.local.get(
|
|
null
|
|
);
|
|
|
|
if (Object.keys(dataWithPossibleAlienProperties).length === 0) {
|
|
return dataWithPossibleAlienProperties;
|
|
}
|
|
|
|
const data: Partial<Record<string, any>> = {};
|
|
this.metaProperties.forEach((property) => {
|
|
data[property] = dataWithPossibleAlienProperties[property];
|
|
});
|
|
|
|
return data;
|
|
}
|
|
|
|
async saveFullData(data: SignerMetaData): Promise<void> {
|
|
await chrome.storage.local.set(data);
|
|
}
|
|
|
|
async clearData(keep: string[]): Promise<void> {
|
|
const toBeRemovedProperties: string[] = [];
|
|
|
|
for (const property of this.metaProperties) {
|
|
if (!keep.includes(property)) {
|
|
toBeRemovedProperties.push(property);
|
|
}
|
|
}
|
|
|
|
await chrome.storage.local.remove(toBeRemovedProperties);
|
|
}
|
|
}
|