Move the notification settings onto the general settings page

This commit is contained in:
2026-10-23 04:11:21 +01:00
parent a5eb2b6a95
commit 5475241371
10 changed files with 24 additions and 51 deletions
@@ -1,7 +1,27 @@
import type { PagePropsType } from "@/src/types";
import type { BunextPageServerFn } from "@moduletrace/bunext/types";
import grabPushOverview from "@/src/functions/backend/db/push/grab-push-overview";
import { ensureVapidKeys } from "@/src/push/vapid";
import grabSettingsServerProps from "../(functions)/grab-settings-server-props";
/**
* The General page: app appearance and behavior, plus this user's
* notification devices and the public key a new device subscribes with.
*/
export const server: BunextPageServerFn<PagePropsType> = async (params) => {
return await grabSettingsServerProps(params);
const settings = await grabSettingsServerProps(params);
if (!settings.props?.person?.id) return settings;
const keys = await ensureVapidKeys().catch(() => null);
return {
props: {
...settings.props,
push_overview: await grabPushOverview({
user_id: settings.props.person.id,
public_key: keys?.public_key || null,
}),
},
};
};
@@ -1,4 +1,5 @@
import AppearanceSection from "./(sections)/appearance-section";
import NotificationsSection from "./(sections)/notifications-section";
import PromptSection from "./(sections)/prompt-section";
import StorageSection from "./(sections)/storage-section";
import VersionSection from "./(sections)/version-section";
@@ -12,6 +13,7 @@ export default function AdminSettingsGeneralPage() {
description="How the app looks and behaves."
>
<AppearanceSection />
<NotificationsSection />
<PromptSection />
<StorageSection />
<VersionSection />
@@ -1,27 +0,0 @@
import type { PagePropsType } from "@/src/types";
import type { BunextPageServerFn } from "@moduletrace/bunext/types";
import grabPushOverview from "@/src/functions/backend/db/push/grab-push-overview";
import { ensureVapidKeys } from "@/src/push/vapid";
import grabSettingsServerProps from "../(functions)/grab-settings-server-props";
/**
* The Notifications page: this user's devices and the public key a new
* device subscribes with.
*/
export const server: BunextPageServerFn<PagePropsType> = async (params) => {
const settings = await grabSettingsServerProps(params);
if (!settings.props?.person?.id) return settings;
const keys = await ensureVapidKeys().catch(() => null);
return {
props: {
...settings.props,
push_overview: await grabPushOverview({
user_id: settings.props.person.id,
public_key: keys?.public_key || null,
}),
},
};
};
@@ -1,16 +0,0 @@
import NotificationsSection from "./(sections)/notifications-section";
import SettingsShell from "../(partials)/settings-shell";
import settingsPageMeta from "../(functions)/settings-page-meta";
export default function AdminSettingsNotificationsPage() {
return (
<SettingsShell
title="Notifications"
description="When a bot needs you, and which devices hear about it."
>
<NotificationsSection />
</SettingsShell>
);
}
export const meta = settingsPageMeta({ label: "Notifications" });