Skip to content

Commit

Permalink
不再存储临时文件到历史
Browse files Browse the repository at this point in the history
  • Loading branch information
qinlili23333 authored Dec 24, 2024
1 parent 656c5e3 commit a138aae
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -609,15 +609,17 @@ <h3 class="dlBtnTitle">
size: file.size,
time: file.time,
}
const store = localStorage.getItem("store")
let records = JSON.parse(store);

if (store && Array.isArray(records)) {
records = records.filter(r => r.link !== record.link)
records.push(record);
localStorage.setItem("store", JSON.stringify(records));
} else {
localStorage.setItem("store", JSON.stringify([record]))
if (!record.link.startsWith("tempdir")){
const store = localStorage.getItem("store")
let records = JSON.parse(store);

if (store && Array.isArray(records)) {
records = records.filter(r => r.link !== record.link)
records.push(record);
localStorage.setItem("store", JSON.stringify(records));
} else {
localStorage.setItem("store", JSON.stringify([record]))
}
}
} else {
Module.msg.change(file.errormsg, "./icon/error.svg", "rgba(232,48,21,0.6)");
Expand All @@ -643,4 +645,4 @@ <h3 class="dlBtnTitle">
</script>
</body>

</html>
</html>

0 comments on commit a138aae

Please sign in to comment.