Skip to content

Commit 4d98840

Browse files
committed
refactor: match name with tauri api
1 parent 85f0f69 commit 4d98840

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

src-electron/preload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
2121
getCliArgs: () => ipcRenderer.invoke('get-cli-args'),
2222
getAppPath: () => ipcRenderer.invoke('get-app-path'),
2323
getDocumentsDir: () => ipcRenderer.invoke('get-documents-dir'),
24-
getAppDataDir: () => ipcRenderer.invoke('get-app-data-dir'),
24+
appLocalDataDir: () => ipcRenderer.invoke('get-app-data-dir'),
2525
getWindowsDrives: () => ipcRenderer.invoke('get-windows-drives'),
2626
showOpenDialog: (options) => ipcRenderer.invoke('show-open-dialog', options),
2727
showSaveDialog: (options) => ipcRenderer.invoke('show-save-dialog', options),

test/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
// Electron detection and setup
8787
if(window.electronAPI){
8888
window.electronAPI.getDocumentsDir().then(d => console.log("Electron documentsDir:", d));
89-
window.electronAPI.getAppDataDir().then(d => console.log("Electron appDataDir:", d));
89+
window.electronAPI.appLocalDataDir().then(d => console.log("Electron appDataDir:", d));
9090
window.electronAPI.getAppPath().then(appPath => {
9191
const nodeSrcPath = appPath + "/../src-tauri/node-src/index.js";
9292
return window.electronAPI.spawnProcess('node', ['--inspect', nodeSrcPath]);

test/test-copy.browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function _setupTests(testTypeSrc, testTypeDst) {
1717
return window.__TAURI__.path.appLocalDataDir();
1818
}
1919
if(window.__ELECTRON__) {
20-
return await window.electronAPI.getAppDataDir() + "/";
20+
return await window.electronAPI.appLocalDataDir() + "/";
2121
}
2222
throw new Error("No native environment detected");
2323
}

test/test-dir.browser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function _setupTests(testType) {
2222
return window.__TAURI__.path.appLocalDataDir();
2323
}
2424
if(window.__ELECTRON__) {
25-
return await window.electronAPI.getAppDataDir() + "/";
25+
return await window.electronAPI.appLocalDataDir() + "/";
2626
}
2727
throw new Error("No native environment detected");
2828
}
@@ -624,4 +624,4 @@ describe(`Dir: Should misc tests`, async function () {
624624
await _RenameFailsWith(`/tauri`, `/some/a/b`, fs.ERR_CODES.EPERM);
625625
await _RenameFailsWith( `/some/a/b`, `/tauri`, fs.ERR_CODES.EPERM);
626626
});
627-
});
627+
});

test/test-file.browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function _setupTests(testType) {
2525
return window.__TAURI__.path.appLocalDataDir();
2626
}
2727
if(window.__ELECTRON__) {
28-
return await window.electronAPI.getAppDataDir() + "/";
28+
return await window.electronAPI.appLocalDataDir() + "/";
2929
}
3030
throw new Error("No native environment detected");
3131
}

test/test-watcher.browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function _setupTests(testType) {
1919
return window.__TAURI__.path.appLocalDataDir();
2020
}
2121
if(window.__ELECTRON__) {
22-
return await window.electronAPI.getAppDataDir() + "/";
22+
return await window.electronAPI.appLocalDataDir() + "/";
2323
}
2424
throw new Error("No native environment detected");
2525
}

test/test.worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function _setupTests(testType) {
5959
if (window.__TAURI__) {
6060
appDataDir = await window.__TAURI__.path.appLocalDataDir();
6161
} else if (window.electronAPI) {
62-
appDataDir = await window.electronAPI.getAppDataDir();
62+
appDataDir = await window.electronAPI.appLocalDataDir();
6363
}
6464
testPath = fs.getTauriVirtualPath(`${appDataDir}test-phoenix-fs`);
6565
consoleLogToShell("using tauri websocket test path: "+ testPath);

0 commit comments

Comments
 (0)