fixing the version check on the bookmarks feature

This commit is contained in:
Rob Petti 2022-11-17 16:08:13 -07:00
parent 33a61f7347
commit 83f52391ae
2 changed files with 11 additions and 11 deletions

View File

@ -59,11 +59,11 @@ export class ManageAccountComponent extends BrowseBase {
private readonly toolsService: ToolsService,
private readonly mastodonService: MastodonWrapperService,
private readonly notificationService: NotificationService,
private readonly userNotificationService: UserNotificationService) {
private readonly userNotificationService: UserNotificationService) {
super();
}
ngOnInit() {
ngOnInit() {
}
ngOnDestroy(): void {
@ -73,7 +73,7 @@ export class ManageAccountComponent extends BrowseBase {
private checkIfBookmarksAreAvailable() {
this.toolsService.getInstanceInfo(this.account.info)
.then((instance: InstanceInfo) => {
if (instance.major >= 3 && instance.minor >= 1) {
if (instance.major == 3 && instance.minor >= 1 || instance.major > 3) {
this.isBookmarksAvailable = true;
} else {
this.isBookmarksAvailable = false;
@ -137,7 +137,7 @@ export class ManageAccountComponent extends BrowseBase {
loadSubPanel(subpanel: 'account' | 'notifications' | 'mentions' | 'dm' | 'favorites' | 'bookmarks'): boolean {
if(this.subPanel === subpanel){
switch(subpanel){
case 'bookmarks':
case 'bookmarks':
this.bookmarksComp.applyGoToTop();
break;
case 'notifications':
@ -151,12 +151,12 @@ export class ManageAccountComponent extends BrowseBase {
break;
case 'favorites':
this.favoritesComp.applyGoToTop();
break;
break;
}
}
this.subPanel = subpanel;
return false;
}

View File

@ -190,7 +190,7 @@ export class ActionBarComponent implements OnInit, OnDestroy {
this.boostPromise = Promise.resolve(true);
}
const account = this.toolsService.getSelectedAccounts()[0];
const account = this.toolsService.getSelectedAccounts()[0];
this.boostPromise = this.boostPromise
.then(() => {
this.boostIsLoading = true;
@ -231,11 +231,11 @@ export class ActionBarComponent implements OnInit, OnDestroy {
}
private favoritePromise: Promise<any>;
favorite(): boolean {
favorite(): boolean {
if (!this.favoritePromise) {
this.favoritePromise = Promise.resolve(true);
}
const account = this.toolsService.getSelectedAccounts()[0];
this.favoritePromise = this.favoritePromise
.then(() => {
@ -282,7 +282,7 @@ export class ActionBarComponent implements OnInit, OnDestroy {
.then(() => {
this.bookmarkingIsLoading = true;
return this.toolsService.getStatusUsableByAccount(account, this.statusWrapper);
})
})
.then((status: Status) => {
if (this.isBookmarked && status.bookmarked) {
return this.mastodonService.unbookmark(account, status);
@ -344,7 +344,7 @@ export class ActionBarComponent implements OnInit, OnDestroy {
private checkIfBookmarksAreAvailable(account: AccountInfo) {
this.toolsService.getInstanceInfo(account)
.then((instance: InstanceInfo) => {
if (instance.major >= 3 && instance.minor >= 1) {
if (instance.major == 3 && instance.minor >= 1 || instance.major > 3) {
this.isBookmarksAvailable = true;
} else {
this.isBookmarksAvailable = false;