Files
gsfdc/demo-dify/dify/web/app/components/header/account-setting/query-params.ts
T
wuzilongandCursor 6519682885 chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 13:59:25 +08:00

27 lines
1.0 KiB
TypeScript

import type { inferParserType } from 'nuqs'
import { parseAsStringLiteral } from 'nuqs'
import { INTEGRATION_SECTION_VALUES } from '@/app/components/integrations/routes'
import { ACCOUNT_SETTING_TAB_VALUES } from './constants'
export const settingsQueryParamName = 'settings'
// Settings is a client-owned full-screen surface, so nuqs' shallow replace defaults are enough.
export const settingsQueryParser = parseAsStringLiteral([
...ACCOUNT_SETTING_TAB_VALUES,
...INTEGRATION_SECTION_VALUES,
] as const)
export type SettingsDestination = inferParserType<typeof settingsQueryParser>
export const isAccountSettingDestination = (
destination: SettingsDestination | null,
): destination is (typeof ACCOUNT_SETTING_TAB_VALUES)[number] => {
return ACCOUNT_SETTING_TAB_VALUES.some((value) => value === destination)
}
export const isIntegrationSettingDestination = (
destination: SettingsDestination | null,
): destination is (typeof INTEGRATION_SECTION_VALUES)[number] => {
return INTEGRATION_SECTION_VALUES.some((value) => value === destination)
}