mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-19 07:14:22 +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 i18n = useI18n();
|
||||||
const [state, _actions] = useMegaStore();
|
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 {
|
function nameFromHexpub(hexpub: string): string {
|
||||||
const profile = data.latest?.profiles[hexpub];
|
const profile = data.latest?.profiles[hexpub];
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ type NostrContactsForm = {
|
|||||||
|
|
||||||
export function SyncContactsForm() {
|
export function SyncContactsForm() {
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
const [state, actions] = useMegaStore();
|
const [state, _actions] = useMegaStore();
|
||||||
const [error, setError] = createSignal<Error>();
|
const [error, setError] = createSignal<Error>();
|
||||||
|
|
||||||
const [feedbackForm, { Form, Field }] = createForm<NostrContactsForm>({
|
const [feedbackForm, { Form, Field }] = createForm<NostrContactsForm>({
|
||||||
@@ -29,7 +29,6 @@ export function SyncContactsForm() {
|
|||||||
try {
|
try {
|
||||||
const npub = f.npub.trim();
|
const npub = f.npub.trim();
|
||||||
await state.mutiny_wallet?.sync_nostr_contacts(npub);
|
await state.mutiny_wallet?.sync_nostr_contacts(npub);
|
||||||
actions.saveNpub(npub);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setError(eify(e));
|
setError(eify(e));
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ type MegaStore = [
|
|||||||
load_stage: LoadStage;
|
load_stage: LoadStage;
|
||||||
settings?: MutinyWalletSettingStrings;
|
settings?: MutinyWalletSettingStrings;
|
||||||
safe_mode?: boolean;
|
safe_mode?: boolean;
|
||||||
npub?: string;
|
|
||||||
preferredInvoiceType: "unified" | "lightning" | "onchain";
|
preferredInvoiceType: "unified" | "lightning" | "onchain";
|
||||||
testflightPromptDismissed: boolean;
|
testflightPromptDismissed: boolean;
|
||||||
should_zap_hodl: boolean;
|
should_zap_hodl: boolean;
|
||||||
@@ -86,7 +85,6 @@ type MegaStore = [
|
|||||||
fetchPrice(fiat: Currency): Promise<number>;
|
fetchPrice(fiat: Currency): Promise<number>;
|
||||||
saveFiat(fiat: Currency): void;
|
saveFiat(fiat: Currency): void;
|
||||||
saveLanguage(lang: string): void;
|
saveLanguage(lang: string): void;
|
||||||
saveNpub(npub: string): void;
|
|
||||||
setPreferredInvoiceType(
|
setPreferredInvoiceType(
|
||||||
type: "unified" | "lightning" | "onchain"
|
type: "unified" | "lightning" | "onchain"
|
||||||
): void;
|
): void;
|
||||||
@@ -136,7 +134,6 @@ export const Provider: ParentComponent = (props) => {
|
|||||||
settings: undefined as MutinyWalletSettingStrings | undefined,
|
settings: undefined as MutinyWalletSettingStrings | undefined,
|
||||||
safe_mode: searchParams.safe_mode === "true",
|
safe_mode: searchParams.safe_mode === "true",
|
||||||
lang: localStorage.getItem("i18nexLng") || undefined,
|
lang: localStorage.getItem("i18nexLng") || undefined,
|
||||||
npub: localStorage.getItem("npub") || undefined,
|
|
||||||
preferredInvoiceType: "unified" as "unified" | "lightning" | "onchain",
|
preferredInvoiceType: "unified" as "unified" | "lightning" | "onchain",
|
||||||
should_zap_hodl: localStorage.getItem("should_zap_hodl") === "true",
|
should_zap_hodl: localStorage.getItem("should_zap_hodl") === "true",
|
||||||
testflightPromptDismissed:
|
testflightPromptDismissed:
|
||||||
@@ -380,10 +377,6 @@ export const Provider: ParentComponent = (props) => {
|
|||||||
localStorage.setItem("i18nextLng", lang);
|
localStorage.setItem("i18nextLng", lang);
|
||||||
setState({ lang });
|
setState({ lang });
|
||||||
},
|
},
|
||||||
saveNpub(npub: string) {
|
|
||||||
localStorage.setItem("npub", npub);
|
|
||||||
setState({ npub });
|
|
||||||
},
|
|
||||||
setPreferredInvoiceType(type: "unified" | "lightning" | "onchain") {
|
setPreferredInvoiceType(type: "unified" | "lightning" | "onchain") {
|
||||||
setState({ preferredInvoiceType: type });
|
setState({ preferredInvoiceType: type });
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user