mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-15 14:38:03 +02:00
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:
@@ -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) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user