Skip to content

Commit 02f3437

Browse files
author
Utsav Krishnan
committed
fix list when not logged in
1 parent 2d56845 commit 02f3437

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

project/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ func updateProblemListCache(sess *Session) {
109109
func list(sess *Session) {
110110
var problems = []*Problem{}
111111
cacheGet("problemList.json", &problems, sess.Root)
112-
112+
if len(problems) == 0 {
113+
updateProblemListCache(sess)
114+
cacheGet("problemList.json", &problems, sess.Root)
115+
}
113116
for _, v := range problems {
114117
fmt.Printf("\t%s [%s] %-25s (%.1f %%)\n", v.Solved, v.Task, v.Title, v.HitRatio)
115118
}
@@ -209,7 +212,7 @@ func solve(task string, sess *Session) {
209212
fmt.Println("Task Doesn't Exist")
210213
}
211214

212-
filename := task + "."+title+ langExtMap[sess.Lang]
215+
filename := task + "." + title + langExtMap[sess.Lang]
213216
template := getTemplate(langExtMap[sess.Lang])
214217

215218
writeCodeFile(filename, text, template)

0 commit comments

Comments
 (0)