Fix absolute paths being prioritized when when merging projects

This commit is contained in:
JannisX11 2024-06-12 22:06:03 +02:00
parent 8d89a18341
commit 22b0d8e118

View File

@ -526,10 +526,6 @@ var codec = new Codec('project', {
c++;
tex_copy.id = c.toString();
}
if (isApp && tex.path && fs.existsSync(tex.path) && !model.meta.backup) {
tex_copy.loadContentFromPath(tex.path)
return tex_copy;
}
if (isApp && tex.relative_path && path) {
let resolved_path = PathModule.resolve(PathModule.dirname(path), tex.relative_path);
if (fs.existsSync(resolved_path)) {
@ -537,6 +533,10 @@ var codec = new Codec('project', {
return tex_copy;
}
}
if (isApp && tex.path && fs.existsSync(tex.path) && !model.meta.backup) {
tex_copy.loadContentFromPath(tex.path)
return tex_copy;
}
if (tex.source && tex.source.substr(0, 5) == 'data:') {
tex_copy.fromDataURL(tex.source)
return tex_copy;