Skip to content

Commit

Permalink
fix: resolve issue with restoring names in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mslxl committed Mar 19, 2024
1 parent de1d1df commit 478c568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/lib/fs/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export function intoSource(
source.language = data.language as LanguageMode
source.source.delete(0, source.source.length)
source.source.insert(0, data.source)
if(data.name){
source.name.delete(0, source.name.length)
source.name.insert(0, data.name)
}
source.timelimit = data.timelimit ?? defaultTimeLimit
source.memorylimit = data.memorylimit ?? defaultMemoryLimit
source.checker = data.checker ?? "wcmp"
Expand Down
2 changes: 1 addition & 1 deletion src/store/source/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class SourceStore {
create(id: string = uuid() ): [Source, string] {
let subDoc = new YjsNS(this.doc, id)
let store = new Source(subDoc)
this.list.insert(0, [subDoc.id])
this.list.push([subDoc.id])
return [store, subDoc.id]
}
createFromStatic(data: StaticSourceData, specifyId: string = uuid()): [Source, string]{
Expand Down

0 comments on commit 478c568

Please sign in to comment.