perf: optimize dashboard loading and builds
This commit is contained in:
135 files changed
+8521
-1718
No files matched your search
@@ -1,8 +1,7 @@
|
||||
import { cache } from "react";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import { db } from "@homarr/db";
|
||||
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
|
||||
import { getRscServerSettingsAsync } from "@homarr/api/server-settings-server";
|
||||
import type { ColorScheme } from "@homarr/definitions";
|
||||
import { colorSchemeCookieKey } from "@homarr/definitions";
|
||||
|
||||
@@ -13,6 +12,6 @@ export const getCurrentColorSchemeAsync = cache(async () => {
|
||||
return cookieValue as ColorScheme;
|
||||
}
|
||||
|
||||
const appearanceSettings = await getServerSettingByKeyAsync(db, "appearance");
|
||||
return appearanceSettings.defaultColorScheme;
|
||||
const serverSettings = await getRscServerSettingsAsync();
|
||||
return serverSettings.appearance.defaultColorScheme;
|
||||
});
|
||||
Reference in new issue
Block a user