mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/general: replace direct API with models
This commit is contained in:
@ -28,22 +28,6 @@ class PageController {
|
||||
showError(message) {
|
||||
this._view.showError(message);
|
||||
}
|
||||
|
||||
static createHistoryCacheProxy(routerCtx, requestPage) {
|
||||
return page => {
|
||||
if (routerCtx.state.response) {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(routerCtx.state.response);
|
||||
});
|
||||
}
|
||||
const promise = requestPage(page);
|
||||
promise.then(response => {
|
||||
routerCtx.state.response = response;
|
||||
routerCtx.save();
|
||||
});
|
||||
return promise;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PageController;
|
||||
|
Reference in New Issue
Block a user