Skip to content

Commit

Permalink
fix list when not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
Utsav Krishnan committed Sep 20, 2020
1 parent 2d56845 commit 02f3437
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions project/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ func updateProblemListCache(sess *Session) {
func list(sess *Session) {
var problems = []*Problem{}
cacheGet("problemList.json", &problems, sess.Root)

if len(problems) == 0 {
updateProblemListCache(sess)
cacheGet("problemList.json", &problems, sess.Root)
}
for _, v := range problems {
fmt.Printf("\t%s [%s] %-25s (%.1f %%)\n", v.Solved, v.Task, v.Title, v.HitRatio)
}
Expand Down Expand Up @@ -209,7 +212,7 @@ func solve(task string, sess *Session) {
fmt.Println("Task Doesn't Exist")
}

filename := task + "."+title+ langExtMap[sess.Lang]
filename := task + "." + title + langExtMap[sess.Lang]
template := getTemplate(langExtMap[sess.Lang])

writeCodeFile(filename, text, template)
Expand Down

0 comments on commit 02f3437

Please sign in to comment.