mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-05 01:42:54 +00:00
copy paste file items
This commit is contained in:
@@ -134,14 +134,14 @@ export const currentTool = writable<Tool | null>(null);
|
||||
export const splitAs = writable(SplitType.FILES);
|
||||
|
||||
export function newGPXFile() {
|
||||
const newFileName = get(_)("menu.new_filename");
|
||||
const newFileName = get(_)("menu.new_file");
|
||||
|
||||
let file = new GPXFile();
|
||||
|
||||
let maxNewFileNumber = 0;
|
||||
get(fileObservers).forEach((f) => {
|
||||
let file = get(f)?.file;
|
||||
if (file && file.metadata.name.startsWith(newFileName)) {
|
||||
if (file && file.metadata.name && file.metadata.name.startsWith(newFileName)) {
|
||||
let number = parseInt(file.metadata.name.split(' ').pop() ?? '0');
|
||||
if (!isNaN(number) && number > maxNewFileNumber) {
|
||||
maxNewFileNumber = number;
|
||||
|
Reference in New Issue
Block a user