mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-18 23:04:25 +01:00
Remove local storage npub
This commit is contained in:
committed by
Paul Miller
parent
91c65ebb0d
commit
e4d0287578
@@ -40,7 +40,10 @@ export function NostrActivity() {
|
||||
const i18n = useI18n();
|
||||
const [state, _actions] = useMegaStore();
|
||||
|
||||
const [data, { refetch }] = createResource(state.npub, fetchZaps);
|
||||
const [data, { refetch }] = createResource(
|
||||
state.mutiny_wallet?.get_npub(),
|
||||
fetchZaps
|
||||
);
|
||||
|
||||
function nameFromHexpub(hexpub: string): string {
|
||||
const profile = data.latest?.profiles[hexpub];
|
||||
|
||||
@@ -14,7 +14,7 @@ type NostrContactsForm = {
|
||||
|
||||
export function SyncContactsForm() {
|
||||
const i18n = useI18n();
|
||||
const [state, actions] = useMegaStore();
|
||||
const [state, _actions] = useMegaStore();
|
||||
const [error, setError] = createSignal<Error>();
|
||||
|
||||
const [feedbackForm, { Form, Field }] = createForm<NostrContactsForm>({
|
||||
@@ -29,7 +29,6 @@ export function SyncContactsForm() {
|
||||
try {
|
||||
const npub = f.npub.trim();
|
||||
await state.mutiny_wallet?.sync_nostr_contacts(npub);
|
||||
actions.saveNpub(npub);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
setError(eify(e));
|
||||
|
||||
@@ -68,7 +68,6 @@ type MegaStore = [
|
||||
load_stage: LoadStage;
|
||||
settings?: MutinyWalletSettingStrings;
|
||||
safe_mode?: boolean;
|
||||
npub?: string;
|
||||
preferredInvoiceType: "unified" | "lightning" | "onchain";
|
||||
testflightPromptDismissed: boolean;
|
||||
should_zap_hodl: boolean;
|
||||
@@ -86,7 +85,6 @@ type MegaStore = [
|
||||
fetchPrice(fiat: Currency): Promise<number>;
|
||||
saveFiat(fiat: Currency): void;
|
||||
saveLanguage(lang: string): void;
|
||||
saveNpub(npub: string): void;
|
||||
setPreferredInvoiceType(
|
||||
type: "unified" | "lightning" | "onchain"
|
||||
): void;
|
||||
@@ -136,7 +134,6 @@ export const Provider: ParentComponent = (props) => {
|
||||
settings: undefined as MutinyWalletSettingStrings | undefined,
|
||||
safe_mode: searchParams.safe_mode === "true",
|
||||
lang: localStorage.getItem("i18nexLng") || undefined,
|
||||
npub: localStorage.getItem("npub") || undefined,
|
||||
preferredInvoiceType: "unified" as "unified" | "lightning" | "onchain",
|
||||
should_zap_hodl: localStorage.getItem("should_zap_hodl") === "true",
|
||||
testflightPromptDismissed:
|
||||
@@ -380,10 +377,6 @@ export const Provider: ParentComponent = (props) => {
|
||||
localStorage.setItem("i18nextLng", lang);
|
||||
setState({ lang });
|
||||
},
|
||||
saveNpub(npub: string) {
|
||||
localStorage.setItem("npub", npub);
|
||||
setState({ npub });
|
||||
},
|
||||
setPreferredInvoiceType(type: "unified" | "lightning" | "onchain") {
|
||||
setState({ preferredInvoiceType: type });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user