mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-02 16:52:31 +00:00
create file when routing with no selection
This commit is contained in:
@@ -381,7 +381,9 @@ export function getFileIds(n: number) {
|
||||
// Helper functions for file operations
|
||||
export const dbUtils = {
|
||||
add: (file: GPXFile) => {
|
||||
file._data.id = getFileIds(1)[0];
|
||||
if (file._data.id === undefined) {
|
||||
file._data.id = getFileIds(1)[0];
|
||||
}
|
||||
return applyGlobal((draft) => {
|
||||
draft.set(file._data.id, freeze(file));
|
||||
});
|
||||
|
Reference in New Issue
Block a user