feat: update general settings
This commit is contained in:
@@ -337,19 +337,19 @@ fn main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Run local relay thread
|
// Run local relay thread
|
||||||
tauri::async_runtime::spawn(async move {
|
//tauri::async_runtime::spawn(async move {
|
||||||
let database = NostrLMDB::open(data_dir.join("local-relay"))
|
// let database = NostrLMDB::open(data_dir.join("local-relay"))
|
||||||
.expect("Error: cannot create database.");
|
// .expect("Error: cannot create database.");
|
||||||
let builder = RelayBuilder::default().database(database).port(1984);
|
// let builder = RelayBuilder::default().database(database).port(1984);
|
||||||
|
//
|
||||||
if let Ok(relay) = LocalRelay::run(builder).await {
|
// if let Ok(relay) = LocalRelay::run(builder).await {
|
||||||
println!("Running local relay: {}", relay.url())
|
// println!("Running local relay: {}", relay.url())
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
loop {
|
// loop {
|
||||||
tokio::time::sleep(Duration::from_secs(60)).await;
|
// tokio::time::sleep(Duration::from_secs(60)).await;
|
||||||
}
|
// }
|
||||||
});
|
//});
|
||||||
|
|
||||||
// Run notification thread
|
// Run notification thread
|
||||||
tauri::async_runtime::spawn(async move {
|
tauri::async_runtime::spawn(async move {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { commands } from "@/commands.gen";
|
import { commands } from "@/commands.gen";
|
||||||
import { cn, replyTime } from "@/commons";
|
import { appSettings, cn, replyTime } from "@/commons";
|
||||||
import { Note } from "@/components/note";
|
import { Note } from "@/components/note";
|
||||||
import { type LumeEvent, LumeWindow } from "@/system";
|
import { type LumeEvent, LumeWindow } from "@/system";
|
||||||
import { CaretDown } from "@phosphor-icons/react";
|
import { CaretDown } from "@phosphor-icons/react";
|
||||||
import { Link, useSearch } from "@tanstack/react-router";
|
import { Link, useSearch } from "@tanstack/react-router";
|
||||||
|
import { useStore } from "@tanstack/react-store";
|
||||||
import { Menu, MenuItem } from "@tauri-apps/api/menu";
|
import { Menu, MenuItem } from "@tauri-apps/api/menu";
|
||||||
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
||||||
import { memo, useCallback, useEffect, useState } from "react";
|
import { memo, useCallback, useEffect, useState } from "react";
|
||||||
@@ -16,6 +17,7 @@ export const ReplyNote = memo(function ReplyNote({
|
|||||||
event: LumeEvent;
|
event: LumeEvent;
|
||||||
className?: string;
|
className?: string;
|
||||||
}) {
|
}) {
|
||||||
|
const trustedOnly = useStore(appSettings, (state) => state.trusted_only);
|
||||||
const search = useSearch({ strict: false });
|
const search = useSearch({ strict: false });
|
||||||
const [isTrusted, setIsTrusted] = useState<boolean>(null);
|
const [isTrusted, setIsTrusted] = useState<boolean>(null);
|
||||||
|
|
||||||
@@ -52,11 +54,13 @@ export const ReplyNote = memo(function ReplyNote({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check();
|
if (trustedOnly) {
|
||||||
|
check();
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (isTrusted !== null && isTrusted === false) {
|
if (isTrusted !== null && isTrusted === false) {
|
||||||
return <div>Not trusted</div>;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ function Screen() {
|
|||||||
description="Shows a warning for notes that have a content warning."
|
description="Shows a warning for notes that have a content warning."
|
||||||
label="content_warning"
|
label="content_warning"
|
||||||
/>
|
/>
|
||||||
|
<Setting
|
||||||
|
name="Trusted Only"
|
||||||
|
description="Only shows note's replies from your inner circle."
|
||||||
|
label="trusted_only"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
@@ -129,7 +134,7 @@ function Screen() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="sticky bottom-0 left-0 w-full h-16 flex items-center justify-end px-3">
|
<div className="sticky bottom-0 left-0 w-full h-16 flex items-center justify-end px-3">
|
||||||
<div className="absolute left-0 bottom-0 w-full h-11 gradient-mask-t-20 bg-white dark:bg-black" />
|
<div className="absolute left-0 bottom-0 w-full h-11 gradient-mask-t-0 bg-neutral-100 dark:bg-neutral-900" />
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => updateSettings()}
|
onClick={() => updateSettings()}
|
||||||
|
|||||||
@@ -45,15 +45,9 @@ const renderer = createRegexRenderer([
|
|||||||
[
|
[
|
||||||
/(?:^|\W)nostr:(\w+)(?!\w)/g,
|
/(?:^|\W)nostr:(\w+)(?!\w)/g,
|
||||||
({ children, key, value }) => (
|
({ children, key, value }) => (
|
||||||
<a
|
<span key={key} className="text-blue-500">
|
||||||
key={key}
|
|
||||||
href={value}
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
className="text-blue-500"
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</a>
|
</span>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
@@ -320,7 +314,7 @@ function Menu({
|
|||||||
top: top,
|
top: top,
|
||||||
left: left,
|
left: left,
|
||||||
}}
|
}}
|
||||||
className="fixed w-[200px] text-sm bg-white dark:bg-black shadow-lg shadow-neutral-500/20 rounded-lg overflow-hidden"
|
className="fixed w-[200px] text-sm bg-white dark:bg-black shadow-lg shadow-neutral-500/20 dark:shadow-none dark:ring-1 dark:ring-neutral-700 rounded-lg overflow-hidden"
|
||||||
>
|
>
|
||||||
{users.map((u, i) => (
|
{users.map((u, i) => (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user