mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-01-04 05:01:13 +00:00
Add request quota system
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {ElemJS, q} from "./elemjs/elemjs.js"
|
||||
import {quota} from "./quota.js"
|
||||
|
||||
class FreezeWidth extends ElemJS {
|
||||
freeze(text) {
|
||||
@@ -79,6 +80,7 @@ class NextPage extends FreezeWidth {
|
||||
const type = this.element.getAttribute("data-type")
|
||||
|
||||
return fetch(`/fragment/user/${this.element.getAttribute("data-username")}/${this.nextPageNumber}?type=${type}`).then(res => res.text()).then(text => {
|
||||
quota.change(-1)
|
||||
q("#next-page-container").remove()
|
||||
this.observer.disconnect()
|
||||
q("#timeline").insertAdjacentHTML("beforeend", text)
|
||||
|
||||
Reference in New Issue
Block a user