This commit is contained in:
Anthony Stirling
2026-01-31 21:31:07 +00:00
parent e04158eed6
commit 27f4e365d7
4 changed files with 7 additions and 14 deletions
@@ -285,8 +285,7 @@ export const usePageEditorExport = ({
const sourceStub = selectors.getStirlingFileStub(sourceFileIds[0]);
if (sourceStub?.localFilePath && renamedFiles[0]) {
try {
// @ts-ignore - Desktop module not available in proprietary build
const { saveToLocalPath } = await import("@desktop/services/localFileSaveService");
const { saveToLocalPath } = await import("@app/services/localFileSaveService");
const result = await saveToLocalPath(renamedFiles[0], sourceStub.localFilePath);
if (result.success) {
console.log(`[PageEditor] Auto-saved to ${sourceStub.localFilePath}`);
@@ -308,8 +307,7 @@ export const usePageEditorExport = ({
const sourceStub = selectors.getStirlingFileStub(sourceFileIds[0]);
if (sourceStub?.localFilePath && renamedFiles.length > 0) {
try {
// @ts-ignore - Desktop module not available in proprietary build
const { saveMultipleFilesWithPrompt } = await import("@desktop/services/localFileSaveService");
const { saveMultipleFilesWithPrompt } = await import("@app/services/localFileSaveService");
const { dirname } = await import("@tauri-apps/api/path");
// Get directory of original file as default
@@ -157,8 +157,7 @@ export default function RightRail() {
// Desktop mode: Show "Save As" dialog for each file
if (isTauri()) {
try {
// @ts-ignore - Desktop module not available in proprietary build
const { showSaveDialog, saveToLocalPath } = await import('@desktop/services/localFileSaveService');
const { showSaveDialog, saveToLocalPath } = await import('@app/services/localFileSaveService');
for (const file of filesToExport) {
const savePath = await showSaveDialog(file.name);
+1 -2
View File
@@ -352,8 +352,7 @@ function FileContextInner({
if (shouldDeleteFromDisk) {
try {
// @ts-ignore - Desktop module not available in proprietary build
const { deleteLocalFile } = await import('@desktop/services/localFileSaveService');
const { deleteLocalFile } = await import('@app/services/localFileSaveService');
for (const file of filesWithLocalPaths) {
const result = await deleteLocalFile(file.path);
@@ -451,8 +451,7 @@ export const useToolOperation = <TParams>(
if (inputStub?.localFilePath) {
try {
console.log('[Tool] Attempting auto-save to:', inputStub.localFilePath);
// @ts-ignore - Desktop module not available in proprietary build
const { saveToLocalPath } = await import('@desktop/services/localFileSaveService');
const { saveToLocalPath } = await import('@app/services/localFileSaveService');
const result = await saveToLocalPath(outputStirlingFiles[0], inputStub.localFilePath);
if (result.success) {
console.log(`[Tool] ✓ Auto-saved to ${inputStub.localFilePath}`);
@@ -478,8 +477,7 @@ export const useToolOperation = <TParams>(
const inputStub = selectors.getStirlingFileStub(toConsumeInputIds[0]);
if (inputStub?.localFilePath) {
try {
// @ts-ignore - Desktop module not available in proprietary build
const { saveMultipleFilesWithPrompt } = await import('@desktop/services/localFileSaveService');
const { saveMultipleFilesWithPrompt } = await import('@app/services/localFileSaveService');
const { dirname } = await import('@tauri-apps/api/path');
// Get directory of original file as default
@@ -608,8 +606,7 @@ export const useToolOperation = <TParams>(
const inputStub = inputStirlingFileStubs[0];
if (inputStub?.localFilePath) {
try {
// @ts-ignore - Desktop module not available in proprietary build
const { saveToLocalPath } = await import('@desktop/services/localFileSaveService');
const { saveToLocalPath } = await import('@app/services/localFileSaveService');
const result = await saveToLocalPath(inputFiles[0], inputStub.localFilePath);
if (result.success) {
console.log(`[Undo] Restored original file to ${inputStub.localFilePath}`);