mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Export: save file variant 1
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 ///
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user