From 83f52391aef03ec283258b82d62a2dbd78bdfde4 Mon Sep 17 00:00:00 2001 From: Rob Petti Date: Thu, 17 Nov 2022 16:08:13 -0700 Subject: [PATCH] fixing the version check on the bookmarks feature --- .../manage-account/manage-account.component.ts | 12 ++++++------ .../stream/status/action-bar/action-bar.component.ts | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/components/floating-column/manage-account/manage-account.component.ts b/src/app/components/floating-column/manage-account/manage-account.component.ts index 0be3c500..1b6cb365 100644 --- a/src/app/components/floating-column/manage-account/manage-account.component.ts +++ b/src/app/components/floating-column/manage-account/manage-account.component.ts @@ -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; } diff --git a/src/app/components/stream/status/action-bar/action-bar.component.ts b/src/app/components/stream/status/action-bar/action-bar.component.ts index 274c302a..6d279743 100644 --- a/src/app/components/stream/status/action-bar/action-bar.component.ts +++ b/src/app/components/stream/status/action-bar/action-bar.component.ts @@ -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; - 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;