This commit is contained in:
SiriusXT 2024-09-04 11:52:05 +00:00
parent e66b865cd6
commit 759ac4a4c8
2 changed files with 7 additions and 5 deletions

View File

@ -173,8 +173,6 @@ async function openDirectory(directory) {
const res = await electron.shell.openPath(directory); const res = await electron.shell.openPath(directory);
if (res) { if (res) {
console.error('Failed to open directory:', res); console.error('Failed to open directory:', res);
} else {
console.log('Directory opened successfully.');
} }
} else { } else {
console.error('Not running in an Electron environment.'); console.error('Not running in an Electron environment.');
@ -185,6 +183,7 @@ async function openDirectory(directory) {
} }
} }
const opendataDirectory = async (directory) => await openDirectory(directory);
export default { export default {
download, download,
@ -196,5 +195,5 @@ export default {
openAttachmentExternally, openAttachmentExternally,
openNoteCustom, openNoteCustom,
openAttachmentCustom, openAttachmentCustom,
openDirectory opendataDirectory
} }

View File

@ -76,10 +76,13 @@ export default class AboutDialog extends BasicWidget {
this.$buildRevision.attr('href', `https://github.com/TriliumNext/Notes/commit/${appInfo.buildRevision}`); this.$buildRevision.attr('href', `https://github.com/TriliumNext/Notes/commit/${appInfo.buildRevision}`);
if (utils.isElectron()) { if (utils.isElectron()) {
this.$dataDirectory.html($('<a></a>', { this.$dataDirectory.html($('<a></a>', {
href: 'file:///' + appInfo.dataDirectory,
text: appInfo.dataDirectory, text: appInfo.dataDirectory,
target: '_blank'
})); }));
this.$dataDirectory.find("a").on('click', () => { this.$dataDirectory.find("a").on('click', (event) => {
openService.openDirectory(appInfo.dataDirectory); event.preventDefault();
openService.opendataDirectory(appInfo.dataDirectory);
}) })
} else { } else {
this.$dataDirectory.text(appInfo.dataDirectory); this.$dataDirectory.text(appInfo.dataDirectory);