mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
fix(export): persist write layout across page switches
This commit is contained in:
@@ -1398,7 +1398,7 @@ function ExportPage() {
|
|||||||
setIsBaseConfigLoading(true)
|
setIsBaseConfigLoading(true)
|
||||||
let isReady = true
|
let isReady = true
|
||||||
try {
|
try {
|
||||||
const [savedPath, savedMedia, savedVoiceAsText, savedExcelCompactColumns, savedTxtColumns, savedConcurrency, savedSessionMap, savedContentMap, savedSessionRecordMap, savedSnsPostCount, exportCacheScope] = await Promise.all([
|
const [savedPath, savedMedia, savedVoiceAsText, savedExcelCompactColumns, savedTxtColumns, savedConcurrency, savedSessionMap, savedContentMap, savedSessionRecordMap, savedSnsPostCount, savedWriteLayout, exportCacheScope] = await Promise.all([
|
||||||
configService.getExportPath(),
|
configService.getExportPath(),
|
||||||
configService.getExportDefaultMedia(),
|
configService.getExportDefaultMedia(),
|
||||||
configService.getExportDefaultVoiceAsText(),
|
configService.getExportDefaultVoiceAsText(),
|
||||||
@@ -1409,6 +1409,7 @@ function ExportPage() {
|
|||||||
configService.getExportLastContentRunMap(),
|
configService.getExportLastContentRunMap(),
|
||||||
configService.getExportSessionRecordMap(),
|
configService.getExportSessionRecordMap(),
|
||||||
configService.getExportLastSnsPostCount(),
|
configService.getExportLastSnsPostCount(),
|
||||||
|
configService.getExportWriteLayout(),
|
||||||
ensureExportCacheScope()
|
ensureExportCacheScope()
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -1421,15 +1422,12 @@ function ExportPage() {
|
|||||||
setExportFolder(downloadsPath)
|
setExportFolder(downloadsPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
setWriteLayout('B')
|
setWriteLayout(savedWriteLayout)
|
||||||
setLastExportBySession(savedSessionMap)
|
setLastExportBySession(savedSessionMap)
|
||||||
setLastExportByContent(savedContentMap)
|
setLastExportByContent(savedContentMap)
|
||||||
setExportRecordsBySession(savedSessionRecordMap)
|
setExportRecordsBySession(savedSessionRecordMap)
|
||||||
setLastSnsExportPostCount(savedSnsPostCount)
|
setLastSnsExportPostCount(savedSnsPostCount)
|
||||||
await Promise.all([
|
await configService.setExportDefaultFormat('json')
|
||||||
configService.setExportWriteLayout('B'),
|
|
||||||
configService.setExportDefaultFormat('json')
|
|
||||||
])
|
|
||||||
|
|
||||||
if (cachedSnsStats && Date.now() - cachedSnsStats.updatedAt <= EXPORT_SNS_STATS_CACHE_STALE_MS) {
|
if (cachedSnsStats && Date.now() - cachedSnsStats.updatedAt <= EXPORT_SNS_STATS_CACHE_STALE_MS) {
|
||||||
setSnsStats({
|
setSnsStats({
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ export type ExportWriteLayout = 'A' | 'B' | 'C'
|
|||||||
export async function getExportWriteLayout(): Promise<ExportWriteLayout> {
|
export async function getExportWriteLayout(): Promise<ExportWriteLayout> {
|
||||||
const value = await config.get(CONFIG_KEYS.EXPORT_WRITE_LAYOUT)
|
const value = await config.get(CONFIG_KEYS.EXPORT_WRITE_LAYOUT)
|
||||||
if (value === 'A' || value === 'B' || value === 'C') return value
|
if (value === 'A' || value === 'B' || value === 'C') return value
|
||||||
return 'A'
|
return 'B'
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setExportWriteLayout(layout: ExportWriteLayout): Promise<void> {
|
export async function setExportWriteLayout(layout: ExportWriteLayout): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user