Skip to content

TagSpaces is an offline, open source, document manager with tagging support

Focus mapique depending on the available geo-tags (#2277)

Stanimir902453d3a632
diff --git a/package-lock.json b/package-lock.json
index 71c51daf9..c6eaf0de9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -44,7 +44,7 @@
"fs-extra": "^10.0.0",
"fscreen": "^1.2.0",
"fuse.js": "^6.6.2",
- "geolocation-utils": "^1.2.5",
+ "geolocation-utils": "^1.2.6",
"html2canvas": "^1.3.3",
"i18next": "^23.4.6",
"i18next-http-backend": "^2.2.2",
@@ -206,7 +206,7 @@
"yarn": "please-use-npm"
},
"optionalDependencies": {
- "@tagspacespro/tagspacespro": "5.0.131"
+ "@tagspacespro/tagspacespro": "5.0.134"
}
},
"node_modules/@adobe/css-tools": {
@@ -19924,9 +19924,9 @@
}
},
"node_modules/@tagspacespro/tagspacespro": {
- "version": "5.0.131",
- "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.131/2439d02f92582f58f8593890f3b317154a455235",
- "integrity": "sha512-nHJuHfwsurZAXfMaVosyQcNdidbv7bA/t8tZOqHHyhzEVNH5yWDyQuVxZcU/yiCKulZbj0M73hSiNIo/qYftXQ==",
+ "version": "5.0.134",
+ "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.134/6064850c0d63eb98738a6f17ebc358c6c3edb9ae",
+ "integrity": "sha512-yGsICp3wrkgDz0V3gDP5nmy27d2GW9+wbwn3qh1wfiil4YWNva4H5+nWGAXUerpbpkZiFjHMxLhdv4XjYgKNig==",
"license": "Proprietary",
"optional": true
},
diff --git a/package.json b/package.json
index b981535ad..fdaa4554b 100644
--- a/package.json
+++ b/package.json
@@ -195,7 +195,7 @@
"fs-extra": "^10.0.0",
"fscreen": "^1.2.0",
"fuse.js": "^6.6.2",
- "geolocation-utils": "^1.2.5",
+ "geolocation-utils": "^1.2.6",
"html2canvas": "^1.3.3",
"i18next": "^23.4.6",
"i18next-http-backend": "^2.2.2",
@@ -245,7 +245,7 @@
"zod-to-json-schema": "^3.24.1"
},
"optionalDependencies": {
- "@tagspacespro/tagspacespro": "5.0.131"
+ "@tagspacespro/tagspacespro": "5.0.134"
},
"devDependencies": {
"@electron/notarize": "^2.5.0",
diff --git a/src/renderer/AppConfig.ts b/src/renderer/AppConfig.ts
index 046792e7a..4aa8c260d 100644
--- a/src/renderer/AppConfig.ts
+++ b/src/renderer/AppConfig.ts
@@ -171,5 +171,9 @@ AppConfig.defaultFileColor = '#33b5be';
AppConfig.defaultCSSRadius = 10;
AppConfig.defaultSpaceBetweenButtons = 10;
AppConfig.aiFolder = 'ai';
+AppConfig.defaultMapBounds = {
+ southWest: { lat: 56, lng: -13 },
+ northEast: { lat: 29, lng: 50 },
+};
export default AppConfig;
diff --git a/src/renderer/hooks/OpenedEntryContextProvider.tsx b/src/renderer/hooks/OpenedEntryContextProvider.tsx
index 885b9989b..03e00e91e 100644
--- a/src/renderer/hooks/OpenedEntryContextProvider.tsx
+++ b/src/renderer/hooks/OpenedEntryContextProvider.tsx
@@ -98,8 +98,8 @@ type OpenedEntryContextData = {
fsEntry: TS.FileSystemEntry,
tabSelected?: string,
) => Promise<boolean>;
- openNextFile: (entries: TS.FileSystemEntry[]) => void;
- openPrevFile: (entries: TS.FileSystemEntry[]) => void;
+ openNextFile: (entries: TS.FileSystemEntry[]) => Promise<TS.FileSystemEntry>;
+ openPrevFile: (entries: TS.FileSystemEntry[]) => Promise<TS.FileSystemEntry>;
toggleEntryFullWidth: () => void;
openLink: (url: string, options?) => void;
//goForward: () => void;
@@ -283,7 +283,9 @@ export const OpenedEntryContextProvider = ({
}
}, [currentDirectoryPath]);
- function openNextFile(entries: TS.FileSystemEntry[]) {
+ function openNextFile(
+ entries: TS.FileSystemEntry[],
+ ): Promise<TS.FileSystemEntry> {
const nextFile: TS.FileSystemEntry = getNextFile(
currentEntry.current?.path,
selectedEntries && selectedEntries.length > 0
@@ -292,18 +294,22 @@ export const OpenedEntryContextProvider = ({
entries,
);
if (nextFile !== undefined) {
- currentLocation
+ return currentLocation
.checkFileEncryptedPromise(nextFile.path)
.then((encrypted) => {
const file = { ...nextFile, isEncrypted: encrypted };
- openFsEntry(file);
- // dispatch(actions.setLastSelectedEntry(nextFile.path));
- setSelectedEntries([file]);
+ return openFsEntry(file).then(() => {
+ setSelectedEntries([file]);
+ return file;
+ });
});
}
+ return Promise.resolve(undefined);
}
- function openPrevFile(entries: TS.FileSystemEntry[]) {
+ function openPrevFile(
+ entries: TS.FileSystemEntry[],
+ ): Promise<TS.FileSystemEntry> {
const prevFile = getPrevFile(
currentEntry.current?.path,
selectedEntries && selectedEntries.length > 0
@@ -312,15 +318,17 @@ export const OpenedEntryContextProvider = ({
entries,
);
if (prevFile !== undefined) {
- currentLocation
+ return currentLocation
.checkFileEncryptedPromise(prevFile.path)
.then((encrypted) => {
const file = { ...prevFile, isEncrypted: encrypted };
- openFsEntry(file);
- // dispatch(actions.setLastSelectedEntry(nextFile.path));
- setSelectedEntries([file]);
+ return openFsEntry(file).then(() => {
+ setSelectedEntries([file]);
+ return file;
+ });
});
}
+ return Promise.resolve(undefined);
}
function getOpenedDirProps(): Promise<TS.DirProp> {
diff --git a/src/renderer/tagspaces.namespace.d.ts b/src/renderer/tagspaces.namespace.d.ts
index dbc55a58b..c81d54785 100644
--- a/src/renderer/tagspaces.namespace.d.ts
+++ b/src/renderer/tagspaces.namespace.d.ts
@@ -240,6 +240,8 @@ export namespace TS {
lastUpdated?: number;
customOrder?: CustomOrder;
perspectiveSettings?: PerspectiveSettings;
+ lat?: number;
+ lng?: number;
}
interface OpenedEntry extends FileSystemEntry {