TIP:
diff --git a/packages/lume-column-timeline/src/home.tsx b/packages/lume-column-timeline/src/home.tsx
index 41274a9b5..5a7ae8f00 100644
--- a/packages/lume-column-timeline/src/home.tsx
+++ b/packages/lume-column-timeline/src/home.tsx
@@ -50,18 +50,7 @@ export function HomeRoute({ colKey }: { colKey: string }) {
if (!lastEvent) return;
return lastEvent.created_at - 1;
},
- initialData: () => {
- const queryCacheData = queryClient.getQueryState([colKey])
- ?.data as NDKEvent[];
- if (queryCacheData) {
- return {
- pageParams: [undefined, 1],
- pages: [queryCacheData],
- };
- }
- },
select: (data) => data?.pages.flatMap((page) => page),
- staleTime: 120 * 1000,
refetchOnWindowFocus: false,
refetchOnMount: false,
});
@@ -115,6 +104,17 @@ export function HomeRoute({ colKey }: { colKey: string }) {
+ ) : !data.length ? (
+
+
+
+
+ Find accounts to follow
+
+
) : (
data.map((item) => renderItem(item))
)}
diff --git a/packages/ui/src/onboarding/finish.tsx b/packages/ui/src/onboarding/finish.tsx
index e4966ac6e..228c58ba6 100644
--- a/packages/ui/src/onboarding/finish.tsx
+++ b/packages/ui/src/onboarding/finish.tsx
@@ -1,5 +1,5 @@
-import { useArk } from "@lume/ark";
import { CheckIcon, LoaderIcon } from "@lume/icons";
+import { useStorage } from "@lume/storage";
import { onboardingAtom } from "@lume/utils";
import { useQueryClient } from "@tanstack/react-query";
import { motion } from "framer-motion";
@@ -7,6 +7,7 @@ import { useSetAtom } from "jotai";
import { useState } from "react";
export function OnboardingFinishScreen() {
+ const storage = useStorage();
const queryClient = useQueryClient();
const setOnboarding = useSetAtom(onboardingAtom);
@@ -15,8 +16,9 @@ export function OnboardingFinishScreen() {
const finish = async () => {
setLoading(true);
- await queryClient.refetchQueries({ queryKey: ["timeline-9999"] });
- await queryClient.refetchQueries({ queryKey: ["foryou-9998"] });
+ if (storage.interests) {
+ await queryClient.invalidateQueries({ queryKey: ["foryou-9998"] });
+ }
setLoading(false);
setOnboarding({ open: false, newUser: false });
diff --git a/packages/ui/src/onboarding/interest.tsx b/packages/ui/src/onboarding/interest.tsx
index 95bc1296b..8b661a9ce 100644
--- a/packages/ui/src/onboarding/interest.tsx
+++ b/packages/ui/src/onboarding/interest.tsx
@@ -35,9 +35,10 @@ export function OnboardingInterestScreen() {
JSON.stringify({ hashtags }),
);
- setLoading(false);
-
- if (save) return navigate("/finish");
+ if (save) {
+ storage.interests = { hashtags, users: [], words: [] };
+ return navigate("/finish");
+ }
} catch (e) {
setLoading(false);
toast.error(String(e));
diff --git a/packages/ui/src/routes/suggest.tsx b/packages/ui/src/routes/suggest.tsx
index af2520981..1630953c7 100644
--- a/packages/ui/src/routes/suggest.tsx
+++ b/packages/ui/src/routes/suggest.tsx
@@ -1,15 +1,6 @@
-import { User, useArk } from "@lume/ark";
-import {
- ArrowLeftIcon,
- ArrowRightIcon,
- CancelIcon,
- LoaderIcon,
- PlusIcon,
-} from "@lume/icons";
-import { cn } from "@lume/utils";
+import { User } from "@lume/ark";
+import { ArrowLeftIcon, ArrowRightIcon, LoaderIcon } from "@lume/icons";
import { useQuery, useQueryClient } from "@tanstack/react-query";
-import { nip19 } from "nostr-tools";
-import { useState } from "react";
import { useNavigate } from "react-router-dom";
import { toast } from "sonner";
import { WindowVirtualizer } from "virtua";
@@ -34,7 +25,6 @@ const LUME_USERS = [
];
export function SuggestRoute({ queryKey }: { queryKey: string[] }) {
- const ark = useArk();
const queryClient = useQueryClient();
const navigate = useNavigate();
@@ -51,40 +41,11 @@ export function SuggestRoute({ queryKey }: { queryKey: string[] }) {
},
});
- const [loading, setLoading] = useState(false);
- const [follows, setFollows] = useState
([]);
-
- // toggle follow state
- const toggleFollow = (pubkey: string) => {
- const arr = follows.includes(pubkey)
- ? follows.filter((i) => i !== pubkey)
- : [...follows, pubkey];
- setFollows(arr);
- };
-
const submit = async () => {
try {
- setLoading(true);
-
- if (!follows.length) return navigate("/");
-
- const publish = await ark.newContactList({
- tags: follows.map((item) => {
- if (item.startsWith("npub1"))
- return ["p", nip19.decode(item).data as string];
- return ["p", item];
- }),
- });
-
- if (publish) {
- await queryClient.refetchQueries({ queryKey: ["timeline-9999"] });
- }
-
- setLoading(false);
-
- return navigate("/");
+ await queryClient.refetchQueries({ queryKey });
+ return navigate("/", { replace: true });
} catch (e) {
- setLoading(false);
toast.error(String(e));
}
};
@@ -135,30 +96,12 @@ export function SuggestRoute({ queryKey }: { queryKey: string[] }) {