fix: dedupe folder contents on re-fetch (#701)

getFiles blindly appended fetched entries to $scope.files, so
re-opening a folder duplicated its children in the tree. Drop any
existing entries at the requested path before appending.
This commit is contained in:
tdurieux
2026-05-06 11:15:33 +03:00
parent c2d43164d0
commit 1254c56223
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -2167,6 +2167,8 @@ angular
const res = await $http.get(
`/api/repo/${$scope.repoId}/files/?path=${encodeURIComponent(path)}&v=${$scope.options.lastUpdateDate}`
);
const normalized = path || "";
$scope.files = $scope.files.filter((f) => f.path !== normalized);
$scope.files.push(...res.data);
return res.data;
} catch (err) {
+1 -1
View File
File diff suppressed because one or more lines are too long