mirror of
https://github.com/lumehq/lume.git
synced 2025-09-28 11:56:23 +02:00
update lib storage
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
|
import { createChannel } from "@libs/storage";
|
||||||
import { NDKEvent, NDKPrivateKeySigner } from "@nostr-dev-kit/ndk";
|
import { NDKEvent, NDKPrivateKeySigner } from "@nostr-dev-kit/ndk";
|
||||||
import { AvatarUploader } from "@shared/avatarUploader";
|
import { AvatarUploader } from "@shared/avatarUploader";
|
||||||
import { CancelIcon, PlusIcon } from "@shared/icons";
|
import { CancelIcon, PlusIcon } from "@shared/icons";
|
||||||
@@ -7,7 +8,6 @@ import { RelayContext } from "@shared/relayProvider";
|
|||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { DEFAULT_AVATAR } from "@stores/constants";
|
import { DEFAULT_AVATAR } from "@stores/constants";
|
||||||
import { dateToUnix } from "@utils/date";
|
import { dateToUnix } from "@utils/date";
|
||||||
import { createChannel } from "@utils/storage";
|
|
||||||
import { Fragment, useContext, useEffect, useState } from "react";
|
import { Fragment, useContext, useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { navigate } from "vite-plugin-ssr/client/router";
|
import { navigate } from "vite-plugin-ssr/client/router";
|
||||||
|
@@ -9,7 +9,7 @@ export function MutedItem({ data }: { data: any }) {
|
|||||||
const [status, setStatus] = useState(data.status);
|
const [status, setStatus] = useState(data.status);
|
||||||
|
|
||||||
const unmute = async () => {
|
const unmute = async () => {
|
||||||
const { updateItemInBlacklist } = await import("@utils/storage");
|
const { updateItemInBlacklist } = await import("@libs/storage");
|
||||||
const res = await updateItemInBlacklist(data.content, 0);
|
const res = await updateItemInBlacklist(data.content, 0);
|
||||||
if (res) {
|
if (res) {
|
||||||
setStatus(0);
|
setStatus(0);
|
||||||
@@ -17,7 +17,7 @@ export function MutedItem({ data }: { data: any }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const mute = async () => {
|
const mute = async () => {
|
||||||
const { updateItemInBlacklist } = await import("@utils/storage");
|
const { updateItemInBlacklist } = await import("@libs/storage");
|
||||||
const res = await updateItemInBlacklist(data.content, 1);
|
const res = await updateItemInBlacklist(data.content, 1);
|
||||||
if (res) {
|
if (res) {
|
||||||
setStatus(1);
|
setStatus(1);
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
|
import { getChannel } from "@libs/storage";
|
||||||
import { NDKEvent, NDKPrivateKeySigner } from "@nostr-dev-kit/ndk";
|
import { NDKEvent, NDKPrivateKeySigner } from "@nostr-dev-kit/ndk";
|
||||||
import { AvatarUploader } from "@shared/avatarUploader";
|
import { AvatarUploader } from "@shared/avatarUploader";
|
||||||
import { CancelIcon, EditIcon } from "@shared/icons";
|
import { CancelIcon, EditIcon } from "@shared/icons";
|
||||||
@@ -7,7 +8,6 @@ import { RelayContext } from "@shared/relayProvider";
|
|||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { DEFAULT_AVATAR } from "@stores/constants";
|
import { DEFAULT_AVATAR } from "@stores/constants";
|
||||||
import { dateToUnix } from "@utils/date";
|
import { dateToUnix } from "@utils/date";
|
||||||
import { getChannel } from "@utils/storage";
|
|
||||||
import { Fragment, useContext, useEffect, useState } from "react";
|
import { Fragment, useContext, useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
import { getChannel, updateChannelMetadata } from "@libs/storage";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { getChannel, updateChannelMetadata } from "@utils/storage";
|
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import useSWR, { useSWRConfig } from "swr";
|
import useSWR, { useSWRConfig } from "swr";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
|
@@ -4,12 +4,12 @@ import { ChannelMessageList } from "@app/channel/components/messageList";
|
|||||||
import { ChannelMessageForm } from "@app/channel/components/messages/form";
|
import { ChannelMessageForm } from "@app/channel/components/messages/form";
|
||||||
import { ChannelMetadata } from "@app/channel/components/metadata";
|
import { ChannelMetadata } from "@app/channel/components/metadata";
|
||||||
import { ChannelUpdateModal } from "@app/channel/components/updateModal";
|
import { ChannelUpdateModal } from "@app/channel/components/updateModal";
|
||||||
|
import { getActiveBlacklist, getBlacklist } from "@libs/storage";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { useChannelMessages } from "@stores/channels";
|
import { useChannelMessages } from "@stores/channels";
|
||||||
import { dateToUnix, getHourAgo } from "@utils/date";
|
import { dateToUnix, getHourAgo } from "@utils/date";
|
||||||
import { usePageContext } from "@utils/hooks/usePageContext";
|
import { usePageContext } from "@utils/hooks/usePageContext";
|
||||||
import { getActiveBlacklist, getBlacklist } from "@utils/storage";
|
|
||||||
import { arrayObjToPureArr } from "@utils/transform";
|
import { arrayObjToPureArr } from "@utils/transform";
|
||||||
import { useContext, useRef } from "react";
|
import { useContext, useRef } from "react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
import { NoteReply } from "@app/note/components/metadata/reply";
|
import { NoteReply } from "@app/note/components/metadata/reply";
|
||||||
import { NoteRepost } from "@app/note/components/metadata/repost";
|
import { NoteRepost } from "@app/note/components/metadata/repost";
|
||||||
import { NoteZap } from "@app/note/components/metadata/zap";
|
import { NoteZap } from "@app/note/components/metadata/zap";
|
||||||
|
import { createReplyNote } from "@libs/storage";
|
||||||
import { NDKEvent } from "@nostr-dev-kit/ndk";
|
import { NDKEvent } from "@nostr-dev-kit/ndk";
|
||||||
import { NDKSubscription } from "@nostr-dev-kit/ndk";
|
import { NDKSubscription } from "@nostr-dev-kit/ndk";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { createReplyNote } from "@utils/storage";
|
|
||||||
import { decode } from "light-bolt11-decoder";
|
import { decode } from "light-bolt11-decoder";
|
||||||
import { useContext, useState } from "react";
|
import { useContext, useState } from "react";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
|
@@ -2,9 +2,9 @@ import { Kind1 } from "@app/note/components/kind1";
|
|||||||
import { NoteMetadata } from "@app/note/components/metadata";
|
import { NoteMetadata } from "@app/note/components/metadata";
|
||||||
import { RepliesList } from "@app/note/components/replies/list";
|
import { RepliesList } from "@app/note/components/replies/list";
|
||||||
import { NoteDefaultUser } from "@app/note/components/user/default";
|
import { NoteDefaultUser } from "@app/note/components/user/default";
|
||||||
|
import { getNoteByID } from "@libs/storage";
|
||||||
import { usePageContext } from "@utils/hooks/usePageContext";
|
import { usePageContext } from "@utils/hooks/usePageContext";
|
||||||
import { noteParser } from "@utils/parser";
|
import { noteParser } from "@utils/parser";
|
||||||
import { getNoteByID } from "@utils/storage";
|
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
|
||||||
const fetcher = ([, id]) => getNoteByID(id);
|
const fetcher = ([, id]) => getNoteByID(id);
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
import { prefetchEvents } from "@libs/ndk";
|
import { prefetchEvents } from "@libs/ndk";
|
||||||
|
import { countTotalNotes, createNote } from "@libs/storage";
|
||||||
import { NDKFilter } from "@nostr-dev-kit/ndk";
|
import { NDKFilter } from "@nostr-dev-kit/ndk";
|
||||||
import { LumeIcon } from "@shared/icons";
|
import { LumeIcon } from "@shared/icons";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { dateToUnix, getHourAgo } from "@utils/date";
|
import { dateToUnix, getHourAgo } from "@utils/date";
|
||||||
import { countTotalNotes, createNote } from "@utils/storage";
|
|
||||||
import { useContext, useEffect, useRef } from "react";
|
import { useContext, useEffect, useRef } from "react";
|
||||||
import { navigate } from "vite-plugin-ssr/client/router";
|
import { navigate } from "vite-plugin-ssr/client/router";
|
||||||
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
import { NoteBase } from "@app/note/components/base";
|
import { NoteBase } from "@app/note/components/base";
|
||||||
import { NoteQuoteRepost } from "@app/note/components/quoteRepost";
|
import { NoteQuoteRepost } from "@app/note/components/quoteRepost";
|
||||||
import { NoteSkeleton } from "@app/note/components/skeleton";
|
import { NoteSkeleton } from "@app/note/components/skeleton";
|
||||||
|
import { getNotesByAuthor } from "@libs/storage";
|
||||||
import { CancelIcon } from "@shared/icons";
|
import { CancelIcon } from "@shared/icons";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { useVirtualizer } from "@tanstack/react-virtual";
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
||||||
import { getNotesByAuthor } from "@utils/storage";
|
|
||||||
import { useEffect, useMemo, useRef } from "react";
|
import { useEffect, useMemo, useRef } from "react";
|
||||||
import useSWRInfinite from "swr/infinite";
|
import useSWRInfinite from "swr/infinite";
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import { NoteBase } from "@app/note/components/base";
|
import { NoteBase } from "@app/note/components/base";
|
||||||
import { NoteQuoteRepost } from "@app/note/components/quoteRepost";
|
import { NoteQuoteRepost } from "@app/note/components/quoteRepost";
|
||||||
import { NoteSkeleton } from "@app/note/components/skeleton";
|
import { NoteSkeleton } from "@app/note/components/skeleton";
|
||||||
|
import { getNotes } from "@libs/storage";
|
||||||
import { useVirtualizer } from "@tanstack/react-virtual";
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
||||||
import { getNotes } from "@utils/storage";
|
|
||||||
import { useEffect, useMemo, useRef } from "react";
|
import { useEffect, useMemo, useRef } from "react";
|
||||||
import useSWRInfinite from "swr/infinite";
|
import useSWRInfinite from "swr/infinite";
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { LayoutDefault } from "./layoutDefault";
|
import { LayoutDefault } from "./layoutDefault";
|
||||||
import { PageContext } from "./types";
|
import { PageContext } from "./types";
|
||||||
|
import { updateLastLogin } from "@libs/storage";
|
||||||
import { RelayProvider } from "@shared/relayProvider";
|
import { RelayProvider } from "@shared/relayProvider";
|
||||||
import { dateToUnix } from "@utils/date";
|
import { dateToUnix } from "@utils/date";
|
||||||
import { PageContextProvider } from "@utils/hooks/usePageContext";
|
import { PageContextProvider } from "@utils/hooks/usePageContext";
|
||||||
import { updateLastLogin } from "@utils/storage";
|
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
export function Shell({
|
export function Shell({
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
|
import { getAccounts, getActiveAccount } from "@libs/storage";
|
||||||
import { ActiveAccount } from "@shared/accounts/active";
|
import { ActiveAccount } from "@shared/accounts/active";
|
||||||
import { InactiveAccount } from "@shared/accounts/inactive";
|
import { InactiveAccount } from "@shared/accounts/inactive";
|
||||||
import { BellIcon, PlusIcon } from "@shared/icons";
|
import { BellIcon, PlusIcon } from "@shared/icons";
|
||||||
import { APP_VERSION } from "@stores/constants";
|
import { APP_VERSION } from "@stores/constants";
|
||||||
import { getAccounts, getActiveAccount } from "@utils/storage";
|
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
|
||||||
const allFetcher = () => getAccounts();
|
const allFetcher = () => getAccounts();
|
||||||
|
@@ -6,7 +6,7 @@ import {
|
|||||||
getLastLogin,
|
getLastLogin,
|
||||||
removeBlockFromDB,
|
removeBlockFromDB,
|
||||||
updateAccount,
|
updateAccount,
|
||||||
} from "@utils/storage";
|
} from "@libs/storage";
|
||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import { createJSONStorage, persist } from "zustand/middleware";
|
import { createJSONStorage, persist } from "zustand/middleware";
|
||||||
import { immer } from "zustand/middleware/immer";
|
import { immer } from "zustand/middleware/immer";
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { getChannels } from "@utils/storage";
|
import { getChannels } from "@libs/storage";
|
||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import { immer } from "zustand/middleware/immer";
|
import { immer } from "zustand/middleware/immer";
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { createChat, getChatMessages, getChatsByPubkey } from "@utils/storage";
|
import { createChat, getChatMessages, getChatsByPubkey } from "@libs/storage";
|
||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import { immer } from "zustand/middleware/immer";
|
import { immer } from "zustand/middleware/immer";
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
import { createNote, getNoteByID } from "@libs/storage";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { createNote, getNoteByID } from "@utils/storage";
|
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
import { createPleb, getPleb } from "@libs/storage";
|
||||||
import NDK from "@nostr-dev-kit/ndk";
|
import NDK from "@nostr-dev-kit/ndk";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { createPleb, getPleb } from "@utils/storage";
|
|
||||||
import { nip19 } from "nostr-tools";
|
import { nip19 } from "nostr-tools";
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
Reference in New Issue
Block a user