mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
feat(threads): ship threads and the Plutonium page to everyone (#3277)
This commit is contained in:
1 parent
1515a8487f
commit
f8505d19f7
53 files changed
+296
-2008
No files matched your search
@@ -2,14 +2,15 @@
|
||||
|
||||
import {
|
||||
clearChannelThreadsTaintCacheForTesting,
|
||||
syncChannelThreadsConfig,
|
||||
getCompiledChannelThreadsConfig,
|
||||
pinChannelThreadsConfigForTesting,
|
||||
} from '@app/api/experiment/ChannelThreadsGate';
|
||||
import {getInstanceConfigRepository} from '@app/api/middleware/ServiceSingletons';
|
||||
import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
|
||||
import {createBuilder, type TestRequestBuilder} from '@app/api/test/TestRequestBuilder';
|
||||
import {
|
||||
type ChannelThreadsConfig,
|
||||
ChannelThreadsConfigSchema,
|
||||
DEFAULT_CHANNEL_THREADS_CONFIG,
|
||||
} from '@fluxer/schema/src/domains/admin/ChannelThreadsSchemas';
|
||||
|
||||
export const THREADS_FEATURE_HEADER = 'X-Fluxer-Features';
|
||||
@@ -22,7 +23,8 @@ export const ALL_THREADS_ACTIVE: Partial<ChannelThreadsConfig> = {
|
||||
};
|
||||
|
||||
export async function setChannelThreadsConfig(patch: Partial<ChannelThreadsConfig>): Promise<void> {
|
||||
await getInstanceConfigRepository().updateChannelThreadsConfig((current) =>
|
||||
const current = getCompiledChannelThreadsConfig().config;
|
||||
pinChannelThreadsConfigForTesting(
|
||||
ChannelThreadsConfigSchema.parse({
|
||||
...patch,
|
||||
ever_enabled: current.ever_enabled || patch.enabled === true,
|
||||
@@ -33,7 +35,7 @@ export async function setChannelThreadsConfig(patch: Partial<ChannelThreadsConfi
|
||||
}
|
||||
|
||||
export function resetChannelThreadsConfig(): void {
|
||||
syncChannelThreadsConfig(null, (raw) => ChannelThreadsConfigSchema.parse(raw ? JSON.parse(raw) : {}));
|
||||
pinChannelThreadsConfigForTesting(DEFAULT_CHANNEL_THREADS_CONFIG);
|
||||
clearChannelThreadsTaintCacheForTesting();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user