fix delay in status selection
This commit is contained in:
parent
0702063f69
commit
f925f08d00
|
@ -56,6 +56,7 @@ export class StatusComponent implements OnInit {
|
||||||
this._statusWrapper = value;
|
this._statusWrapper = value;
|
||||||
// console.warn(value.status);
|
// console.warn(value.status);
|
||||||
this.status = value.status;
|
this.status = value.status;
|
||||||
|
this.isSelected = value.isSelected;
|
||||||
|
|
||||||
if (this.status.reblog) {
|
if (this.status.reblog) {
|
||||||
this.reblog = true;
|
this.reblog = true;
|
||||||
|
|
|
@ -163,8 +163,12 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||||
let contextStatuses = [...context.ancestors, status, ...context.descendants]
|
let contextStatuses = [...context.ancestors, status, ...context.descendants]
|
||||||
const position = context.ancestors.length;
|
const position = context.ancestors.length;
|
||||||
|
|
||||||
for (const s of contextStatuses) {
|
for (let i = 0; i < contextStatuses.length; i++) {
|
||||||
|
let s = contextStatuses[i];
|
||||||
const wrapper = new StatusWrapper(s, currentAccount);
|
const wrapper = new StatusWrapper(s, currentAccount);
|
||||||
|
|
||||||
|
if(i == position) wrapper.isSelected = true;
|
||||||
|
|
||||||
this.statuses.push(wrapper);
|
this.statuses.push(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +181,6 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||||
.then((position: number) => {
|
.then((position: number) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const el = this.statusChildren.toArray()[position];
|
const el = this.statusChildren.toArray()[position];
|
||||||
el.isSelected = true;
|
|
||||||
|
|
||||||
//el.elem.nativeElement.scrollIntoViewIfNeeded({ behavior: 'auto', block: 'start', inline: 'nearest' });
|
//el.elem.nativeElement.scrollIntoViewIfNeeded({ behavior: 'auto', block: 'start', inline: 'nearest' });
|
||||||
|
|
||||||
|
|
|
@ -17,4 +17,6 @@ export class StatusWrapper {
|
||||||
public status: Status,
|
public status: Status,
|
||||||
public provider: AccountInfo
|
public provider: AccountInfo
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
|
public isSelected: boolean;
|
||||||
}
|
}
|
Loading…
Reference in New Issue