Skip to content

Commit efa16b1

Browse files
authored
Update localstorage.js
1 parent 4ac9112 commit efa16b1

File tree

1 file changed

+0
-86
lines changed

1 file changed

+0
-86
lines changed

localstorage.js

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -62,99 +62,13 @@ function updateModFilesLS() {
6262

6363
// repos
6464

65-
// create a repository object
66-
function createRepoObj(fullName, selBranch, pushAccess,
67-
branches, private, isFork, empty) {
68-
69-
return {
70-
fullName,
71-
selBranch,
72-
pushAccess,
73-
branches,
74-
private,
75-
isFork,
76-
empty
77-
}
78-
79-
}
80-
81-
function addRepoObjToLS(repoObj) {
82-
83-
modifiedRepos[repoObj.fullName] = repoObj;
84-
85-
updateModReposLS();
86-
87-
}
88-
89-
function updateRepoSelectedBranchLS(fullName, selBranch) {
90-
91-
modifiedRepos[fullName].selBranch = selBranch;
92-
93-
updateModReposLS();
94-
95-
}
96-
97-
function updateRepoPushAccessLS(fullName, pushAccess) {
98-
99-
modifiedRepos[fullName].pushAccess = pushAccess;
100-
101-
updateModReposLS();
102-
103-
}
104-
105-
function updateRepoBranchesLS(fullName, branches) {
106-
107-
modifiedRepos[fullName].branches = branches;
108-
109-
updateModReposLS();
110-
111-
}
112-
113-
function updateRepoPrivateStatusLS(fullName, private) {
114-
115-
modifiedRepos[fullName].private = private;
116-
117-
updateModReposLS();
118-
119-
}
120-
121-
function updateRepoEmptyStatusLS(fullName, empty) {
122-
123-
modifiedRepos[fullName].empty = empty;
124-
125-
updateModReposLS();
126-
127-
}
128-
12965
function updateModReposLS() {
13066

13167
setStorage('modifiedRepos', JSON.stringify(Object.entries(modifiedRepos)));
13268

13369
}
13470

13571

136-
// fetch repo obj from git
137-
// and save to local storage
138-
async function fetchRepoAndSaveToLS(treeLoc) {
139-
140-
// get repository from git
141-
const repo = await git.getRepo(treeLoc);
142-
143-
// if didn't encounter an error
144-
if (!repo.message) {
145-
146-
// create repo obj
147-
const repoObj = createRepoObj(repo.full_name, repo.default_branch, (item.permissions.push ?? false),
148-
null, repo.private, repo.fork, false);
149-
150-
// add repo obj to local storage
151-
addRepoObjToLS(repoObj);
152-
153-
}
154-
155-
}
156-
157-
15872
// miscellaneous
15973

16074
function saveTreeLocLS(treeLoc) {

0 commit comments

Comments
 (0)