feat: use latest nostr sdk
This commit is contained in:
@@ -464,7 +464,7 @@ async updateColumn(label: string, width: number, height: number, x: number, y: n
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async reloadColumn(label: string) : Promise<Result<boolean, string>> {
|
||||
async reloadColumn(label: string) : Promise<Result<null, string>> {
|
||||
try {
|
||||
return { status: "ok", data: await TAURI_INVOKE("reload_column", { label }) };
|
||||
} catch (e) {
|
||||
|
||||
@@ -74,6 +74,7 @@ export function Column({ column }: { column: LumeColumn }) {
|
||||
<div className="flex flex-col gap-px size-full">
|
||||
<Header
|
||||
label={column.label}
|
||||
webviewLabel={webviewLabel}
|
||||
name={column.name}
|
||||
account={column.account}
|
||||
/>
|
||||
@@ -85,9 +86,10 @@ export function Column({ column }: { column: LumeColumn }) {
|
||||
|
||||
function Header({
|
||||
label,
|
||||
webviewLabel,
|
||||
name,
|
||||
account,
|
||||
}: { label: string; name: string; account?: string }) {
|
||||
}: { label: string; webviewLabel: string; name: string; account?: string }) {
|
||||
const [title, setTitle] = useState("");
|
||||
const [isChanged, setIsChanged] = useState(false);
|
||||
|
||||
@@ -100,7 +102,7 @@ function Header({
|
||||
MenuItem.new({
|
||||
text: "Reload",
|
||||
action: async () => {
|
||||
await commands.reloadColumn(label);
|
||||
await commands.reloadColumn(webviewLabel);
|
||||
},
|
||||
}),
|
||||
PredefinedMenuItem.new({ item: "Separator" }),
|
||||
|
||||
@@ -137,6 +137,13 @@ function Account({ pubkey }: { pubkey: string }) {
|
||||
e.preventDefault();
|
||||
|
||||
const items = await Promise.all([
|
||||
MenuItem.new({
|
||||
text: "Unlock",
|
||||
enabled: !isActive || true,
|
||||
action: () =>
|
||||
LumeWindow.openPopup(`/set-signer/${pubkey}`, undefined, false),
|
||||
}),
|
||||
PredefinedMenuItem.new({ item: "Separator" }),
|
||||
MenuItem.new({
|
||||
text: "View Profile",
|
||||
action: () => LumeWindow.openProfile(pubkey),
|
||||
|
||||
@@ -26,6 +26,7 @@ export const Route = createLazyFileRoute("/_layout/")({
|
||||
});
|
||||
|
||||
function Screen() {
|
||||
const { accounts } = Route.useRouteContext();
|
||||
const columns = useStore(appColumns, (state) => state);
|
||||
|
||||
const [emblaRef, emblaApi] = useEmblaCarousel({
|
||||
@@ -161,7 +162,10 @@ function Screen() {
|
||||
getSystemColumns();
|
||||
} else {
|
||||
const parsed: LumeColumn[] = JSON.parse(prevColumns);
|
||||
appColumns.setState(() => parsed);
|
||||
const fil = parsed.filter((item) =>
|
||||
item.account ? accounts.includes(item.account) : item,
|
||||
);
|
||||
appColumns.setState(() => fil);
|
||||
}
|
||||
} else {
|
||||
window.localStorage.setItem("columns", JSON.stringify(columns));
|
||||
|
||||
@@ -197,6 +197,10 @@ function Screen() {
|
||||
};
|
||||
|
||||
const submit = async () => {
|
||||
if (!text.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentUser) {
|
||||
const signer = await commands.hasSigner(currentUser);
|
||||
|
||||
|
||||
@@ -174,8 +174,8 @@ export const LumeWindow = {
|
||||
label: `popup-${nanoid()}`,
|
||||
url,
|
||||
title: title ?? "",
|
||||
width: 400,
|
||||
height: 500,
|
||||
width: 360,
|
||||
height: 460,
|
||||
maximizable: false,
|
||||
minimizable: false,
|
||||
hidden_title: !!title,
|
||||
|
||||
Reference in New Issue
Block a user