Merge pull request #471 from rpetti/fix-bookmarks

fixing the version check on the bookmarks feature
This commit is contained in:
Nicolas Constant 2022-11-18 19:51:44 +01:00 committed by GitHub
commit 644b0d0b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 12 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
patreon: nicolasconstant

View File

@ -44,4 +44,5 @@ deploy:
folder: /
application: dist.zip
on:
APPVEYOR_REPO_TAG: true
branch: master
# APPVEYOR_REPO_TAG: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

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;