hide pixelfed unsupported polls/scheduling
This commit is contained in:
parent
5b6b463b90
commit
58414baa8e
|
@ -21,9 +21,9 @@
|
|||
(suggestionSelectedEvent)="suggestionSelected($event)" (hasSuggestionsEvent)="suggestionsChanged($event)">
|
||||
</app-autosuggest>
|
||||
|
||||
<app-poll-editor *ngIf="pollIsActive"></app-poll-editor>
|
||||
<app-poll-editor *ngIf="instanceSupportsPoll && pollIsActive"></app-poll-editor>
|
||||
|
||||
<app-status-scheduler class="scheduler" *ngIf="scheduleIsActive"></app-status-scheduler>
|
||||
<app-status-scheduler class="scheduler" *ngIf="instanceSupportsScheduling && scheduleIsActive"></app-status-scheduler>
|
||||
|
||||
<div class="status-editor__footer" #footer>
|
||||
<button type="submit" title="reply" class="status-editor__footer--send-button" *ngIf="statusReplyingToWrapper">
|
||||
|
@ -54,11 +54,13 @@
|
|||
<fa-icon [icon]="faEnvelope" *ngIf="selectedPrivacy === 'DM'"></fa-icon>
|
||||
</a>
|
||||
|
||||
<a href class="status-editor__footer--link status-editor__footer--add-poll" title="add poll" (click)="addPoll()">
|
||||
<a href *ngIf="instanceSupportsPoll"
|
||||
class="status-editor__footer--link status-editor__footer--add-poll" title="add poll" (click)="addPoll()">
|
||||
<fa-icon [icon]="faPollH"></fa-icon>
|
||||
</a>
|
||||
|
||||
<a href class="status-editor__footer--link" title="schedule" (click)="schedule()">
|
||||
<a href *ngIf="instanceSupportsScheduling"
|
||||
class="status-editor__footer--link" title="schedule" (click)="schedule()">
|
||||
<fa-icon [icon]="faClock"></fa-icon>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@ import { ContextMenuService, ContextMenuComponent } from 'ngx-contextmenu';
|
|||
|
||||
import { MastodonService, VisibilityEnum, PollParameters } from '../../services/mastodon.service';
|
||||
import { Status, Attachment } from '../../services/models/mastodon.interfaces';
|
||||
import { ToolsService } from '../../services/tools.service';
|
||||
import { ToolsService, InstanceInfo, InstanceType } from '../../services/tools.service';
|
||||
import { NotificationService } from '../../services/notification.service';
|
||||
import { StatusWrapper } from '../../models/common.model';
|
||||
import { AccountInfo } from '../../states/accounts.state';
|
||||
|
@ -109,6 +109,8 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
|||
isSending: boolean;
|
||||
mentionTooFarAwayError: boolean;
|
||||
autosuggestData: string = null;
|
||||
instanceSupportsPoll = true;
|
||||
instanceSupportsScheduling = true;
|
||||
private statusLoaded: boolean;
|
||||
private hasSuggestions: boolean;
|
||||
|
||||
|
@ -295,6 +297,19 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
|||
if (!this.statusReplyingToWrapper && !this.replyingUserHandle) {
|
||||
this.getDefaultPrivacy();
|
||||
}
|
||||
|
||||
this.toolsService.getInstanceInfo(this.selectedAccount)
|
||||
.then((instance: InstanceInfo) => {
|
||||
if(instance.type === InstanceType.Pixelfed){
|
||||
this.instanceSupportsPoll = false;
|
||||
this.instanceSupportsScheduling = false;
|
||||
this.pollIsActive = false;
|
||||
this.scheduleIsActive = false;
|
||||
} else {
|
||||
this.instanceSupportsPoll = true;
|
||||
this.instanceSupportsScheduling = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue