mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Apply some review comments
This commit is contained in:
@ -17,7 +17,6 @@ document.addEventListener("alpine:init", () => {
|
||||
page: Number.parseInt(initialUrlParams.get("page")) || 1,
|
||||
pushstate: History.Push /* Used to avoid pushing a state on a back action */,
|
||||
loading: false,
|
||||
config: {} as AlbumConfig,
|
||||
|
||||
async init() {
|
||||
await this.fetchPictures();
|
||||
@ -34,6 +33,13 @@ document.addEventListener("alpine:init", () => {
|
||||
this.config = config;
|
||||
},
|
||||
|
||||
getPage(page: number) {
|
||||
return this.pictures.slice(
|
||||
(page - 1) * config.maxPageSize,
|
||||
config.maxPageSize * page,
|
||||
);
|
||||
},
|
||||
|
||||
async fetchPictures() {
|
||||
this.loading = true;
|
||||
this.pictures = await paginated(picturesFetchPictures, {
|
||||
|
Reference in New Issue
Block a user