mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
Better UX
This commit is contained in:
parent
e15b03ef9f
commit
36c3b726b6
@ -148,7 +148,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateStats() {
|
updateStats() {
|
||||||
this.$root.api('stats').then(stats => {
|
this.$root.api('stats', {}, false, true).then(stats => {
|
||||||
this.stats = stats;
|
this.stats = stats;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -385,15 +385,19 @@ export default class MiOS extends EventEmitter {
|
|||||||
* @param data パラメータ
|
* @param data パラメータ
|
||||||
*/
|
*/
|
||||||
@autobind
|
@autobind
|
||||||
public api(endpoint: string, data: { [x: string]: any } = {}, forceFetch = false): Promise<{ [x: string]: any }> {
|
public api(endpoint: string, data: { [x: string]: any } = {}, forceFetch = false, silent = false): Promise<{ [x: string]: any }> {
|
||||||
if (++pending === 1) {
|
if (!silent) {
|
||||||
spinner = document.createElement('div');
|
if (++pending === 1) {
|
||||||
spinner.setAttribute('id', 'wait');
|
spinner = document.createElement('div');
|
||||||
document.body.appendChild(spinner);
|
spinner.setAttribute('id', 'wait');
|
||||||
|
document.body.appendChild(spinner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onFinally = () => {
|
const onFinally = () => {
|
||||||
if (--pending === 0) spinner.parentNode.removeChild(spinner);
|
if (!silent) {
|
||||||
|
if (--pending === 0) spinner.parentNode.removeChild(spinner);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const promise = new Promise((resolve, reject) => {
|
const promise = new Promise((resolve, reject) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user