v0.11.3 - fix post manager cache not clear when switch booru
This commit is contained in:
parent
0d63638b82
commit
793d0342ff
File diff suppressed because one or more lines are too long
2
dist/index.html
vendored
2
dist/index.html
vendored
@ -16,7 +16,7 @@
|
||||
|
||||
gtag('config', 'G-59HBGP98WR');
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-B055pf9K.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-BtOtuQPY.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Plu04C2a.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "danbooru-viewer",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"version": "0.11.2",
|
||||
"version": "0.11.3",
|
||||
"scripts": {
|
||||
"dev": "bun x vite",
|
||||
"build": "bun x vite build",
|
||||
|
@ -27,10 +27,7 @@ export class $PostGrid extends $Layout {
|
||||
setInterval(async () => { if (this.inDOM() && document.documentElement.scrollTop === 0) await this.posts.fetchPosts('newer'); }, 10000);
|
||||
Booru.events.on('set', () => {
|
||||
this.removeAll();
|
||||
if (this.posts.finished) {
|
||||
this.posts.finished = false;
|
||||
this.loader();
|
||||
}
|
||||
this.loader();
|
||||
})
|
||||
this.on('resize', () => this.resize())
|
||||
// this.on('afterRender', () => {
|
||||
@ -98,7 +95,6 @@ export class $PostGrid extends $Layout {
|
||||
}
|
||||
|
||||
removeAll() {
|
||||
this.posts.clear();
|
||||
this.$posts.clear();
|
||||
this.$focus.layer(100).removeAll();
|
||||
this.animate({opacity: [1, 0]}, {duration: 300, easing: 'ease'}, () => this.clear().render())
|
||||
|
@ -13,6 +13,12 @@ export class PostManager {
|
||||
constructor(tags?: string) {
|
||||
this.tags = tags;
|
||||
PostManager.managers.set(this.tags, this);
|
||||
Booru.events.on('set', () => {
|
||||
this.clear();
|
||||
if (this.finished) {
|
||||
this.finished = false;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
static get(tags: string | undefined) {
|
||||
|
Loading…
Reference in New Issue
Block a user