Better progress bar
This commit is contained in:
parent
8234862bf7
commit
b65e038686
1 changed files with 17 additions and 1 deletions
|
@ -51,10 +51,18 @@
|
||||||
|
|
||||||
Progress.start();
|
Progress.start();
|
||||||
|
|
||||||
|
const fetched = false;
|
||||||
|
|
||||||
|
// チャンネル概要読み込み
|
||||||
this.api('channels/show', {
|
this.api('channels/show', {
|
||||||
channel_id: this.id
|
channel_id: this.id
|
||||||
}).then(channel => {
|
}).then(channel => {
|
||||||
|
if (fetched) {
|
||||||
Progress.done();
|
Progress.done();
|
||||||
|
} else {
|
||||||
|
Progress.set(0.5);
|
||||||
|
fetched = true;
|
||||||
|
}
|
||||||
|
|
||||||
this.update({
|
this.update({
|
||||||
fetching: false,
|
fetching: false,
|
||||||
|
@ -64,9 +72,17 @@
|
||||||
document.title = channel.title + ' | Misskey'
|
document.title = channel.title + ' | Misskey'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 投稿読み込み
|
||||||
this.api('channels/posts', {
|
this.api('channels/posts', {
|
||||||
channel_id: this.id
|
channel_id: this.id
|
||||||
}).then(posts => {
|
}).then(posts => {
|
||||||
|
if (fetched) {
|
||||||
|
Progress.done();
|
||||||
|
} else {
|
||||||
|
Progress.set(0.5);
|
||||||
|
fetched = true;
|
||||||
|
}
|
||||||
|
|
||||||
this.update({
|
this.update({
|
||||||
postsFetching: false,
|
postsFetching: false,
|
||||||
posts: posts
|
posts: posts
|
||||||
|
|
Loading…
Reference in a new issue