Export: save file variant 1

This commit is contained in:
Enrico Ros
2025-10-29 08:54:05 -07:00
parent 98bd3d6da0
commit d353fc4c63
2 changed files with 12 additions and 2 deletions
+6 -2
View File
@@ -14,6 +14,8 @@ import { Release } from '~/common/app.release';
import { createModuleLogger } from '~/common/logger';
import { downloadBlob } from '~/common/util/downloadUtils';
import { tradeFileVariant } from './trade.client';
// configuration
const BACKUP_FILE_FORMAT = 'Big-AGI Flash File';
@@ -765,8 +767,10 @@ export function FlashRestore(props: { unlockRestore?: boolean }) {
}
// Check if nothing was selected
if (!restoreLocalStorageEnabled && !restoreIndexedDBEnabled)
if (!restoreLocalStorageEnabled && !restoreIndexedDBEnabled) {
// noinspection ExceptionCaughtLocallyJS
throw new Error('No data was selected for restore. Please select at least one option.');
}
// 3. Close the modal cleanly first to prevent React DOM errors during unmount
// Set state to idle and clear backup data to trigger modal close
@@ -943,7 +947,7 @@ export function FlashBackup(props: {
event.ctrlKey, // control forces a traditional browser download - default: fileSave
includeImages,
includeSettings,
`Big-AGI-flash${includeImages ? '+images' : ''}${includeSettings ? '' : '-nosets'}${event.ctrlKey ? '-download' : ''}-${dateStr}.json`,
`Big-AGI-${tradeFileVariant()}-flash${includeImages ? '+images' : ''}${includeSettings ? '' : '-nosets'}${event.ctrlKey ? '-download' : ''}-${dateStr}.json`,
);
setBackupState(success ? 'success' : 'idle');
} catch (error: any) {
+6
View File
@@ -4,6 +4,7 @@ import { SystemPurposeId, SystemPurposes } from '../../data';
import { Brand } from '~/common/app.config';
import { DataAtRestV1 } from '~/common/stores/chat/chats.converters';
import { Release } from '~/common/app.release';
import { capitalizeFirstLetter } from '~/common/util/textUtils';
import { conversationTitle, DConversation, excludeSystemMessages } from '~/common/stores/chat/chat.conversation';
import { llmsStoreState } from '~/common/stores/llms/store-llms';
@@ -16,6 +17,11 @@ import { useFolderStore } from '~/common/stores/folders/store-chat-folders';
import type { ImportedOutcome } from './ImportOutcomeModal';
export function tradeFileVariant() {
return `${capitalizeFirstLetter(Release.TenantSlug)}`
}
/// IMPORT ///
/**