Skip to content

Commit

Permalink
Remove local storage npub
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored and futurepaul committed Mar 26, 2024
1 parent 91c65eb commit e4d0287
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/components/NostrActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 1 addition & 2 deletions src/components/SyncContactsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>({
Expand All @@ -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));
Expand Down
7 changes: 0 additions & 7 deletions src/state/megaStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 });
},
Expand Down

0 comments on commit e4d0287

Please sign in to comment.