|
@@ -80,17 +80,14 @@ func SetRecentDoc(doc *RecentDoc) (err error) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
- update := false
|
|
|
|
for i, c := range recentDocs {
|
|
for i, c := range recentDocs {
|
|
if c.RootID == doc.RootID {
|
|
if c.RootID == doc.RootID {
|
|
- recentDocs[i] = doc
|
|
|
|
- update = true
|
|
|
|
|
|
+ recentDocs = append(recentDocs[:i], recentDocs[i+1:]...)
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if !update {
|
|
|
|
- recentDocs = append([]*RecentDoc{doc}, recentDocs...)
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ recentDocs = append([]*RecentDoc{doc}, recentDocs...)
|
|
if 32 < len(recentDocs) {
|
|
if 32 < len(recentDocs) {
|
|
recentDocs = recentDocs[:32]
|
|
recentDocs = recentDocs[:32]
|
|
}
|
|
}
|