added settings to disable remote status fetching
This commit is contained in:
parent
49a87aeef0
commit
15ab7ba56e
|
@ -94,6 +94,15 @@
|
||||||
<span class="sub-section__title" *ngIf="contentWarningPolicyChanged"><br/>this settings needs a <a href (click)="reload()">reload</a> to be effective.</span>
|
<span class="sub-section__title" *ngIf="contentWarningPolicyChanged"><br/>this settings needs a <a href (click)="reload()">reload</a> to be effective.</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h4 class="panel__subtitle">Other</h4>
|
||||||
|
<div class="sub-section">
|
||||||
|
<input class="sub-section__checkbox" [(ngModel)]="disableRemoteStatusFetchingEnabled"
|
||||||
|
(change)="onDisableRemoteStatusFetchingChanged()" type="checkbox" name="disableRemoteFetching" value="disableRemoteFetching"
|
||||||
|
id="disableRemoteFetching">
|
||||||
|
<label class="noselect sub-section__label" for="disableRemoteFetching">disable remote status fetching</label>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h4 class="panel__subtitle">About</h4>
|
<h4 class="panel__subtitle">About</h4>
|
||||||
<p class="version">
|
<p class="version">
|
||||||
Sengi version: {{version}}<br />
|
Sengi version: {{version}}<br />
|
||||||
|
|
|
@ -21,6 +21,7 @@ export class SettingsComponent implements OnInit {
|
||||||
notificationForm: FormGroup;
|
notificationForm: FormGroup;
|
||||||
|
|
||||||
disableAutofocusEnabled: boolean;
|
disableAutofocusEnabled: boolean;
|
||||||
|
disableRemoteStatusFetchingEnabled: boolean;
|
||||||
disableAvatarNotificationsEnabled: boolean;
|
disableAvatarNotificationsEnabled: boolean;
|
||||||
disableSoundsEnabled: boolean;
|
disableSoundsEnabled: boolean;
|
||||||
version: string;
|
version: string;
|
||||||
|
@ -78,6 +79,7 @@ export class SettingsComponent implements OnInit {
|
||||||
this.disableAutofocusEnabled = settings.disableAutofocus;
|
this.disableAutofocusEnabled = settings.disableAutofocus;
|
||||||
this.disableAvatarNotificationsEnabled = settings.disableAvatarNotifications;
|
this.disableAvatarNotificationsEnabled = settings.disableAvatarNotifications;
|
||||||
this.disableSoundsEnabled = settings.disableSounds;
|
this.disableSoundsEnabled = settings.disableSounds;
|
||||||
|
this.disableRemoteStatusFetchingEnabled = settings.disableRemoteStatusFetching;
|
||||||
|
|
||||||
if (!settings.columnSwitchingWinAlt) {
|
if (!settings.columnSwitchingWinAlt) {
|
||||||
this.columnShortcutEnabled = ColumnShortcut.Ctrl;
|
this.columnShortcutEnabled = ColumnShortcut.Ctrl;
|
||||||
|
@ -172,6 +174,12 @@ export class SettingsComponent implements OnInit {
|
||||||
this.toolsService.saveSettings(settings);
|
this.toolsService.saveSettings(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDisableRemoteStatusFetchingChanged() {
|
||||||
|
let settings = this.toolsService.getSettings();
|
||||||
|
settings.disableRemoteStatusFetching = this.disableRemoteStatusFetchingEnabled;
|
||||||
|
this.toolsService.saveSettings(settings);
|
||||||
|
}
|
||||||
|
|
||||||
onDisableAvatarNotificationsChanged() {
|
onDisableAvatarNotificationsChanged() {
|
||||||
let settings = this.toolsService.getSettings();
|
let settings = this.toolsService.getSettings();
|
||||||
settings.disableAvatarNotifications = this.disableAvatarNotificationsEnabled;
|
settings.disableAvatarNotifications = this.disableAvatarNotificationsEnabled;
|
||||||
|
|
|
@ -22,6 +22,7 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
isThread = true;
|
isThread = true;
|
||||||
hasContentWarnings = false;
|
hasContentWarnings = false;
|
||||||
|
private remoteStatusFetchingDisabled = false;
|
||||||
|
|
||||||
bufferStream: Status[] = []; //html compatibility only
|
bufferStream: Status[] = []; //html compatibility only
|
||||||
|
|
||||||
|
@ -57,6 +58,9 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||||
private readonly mastodonService: MastodonWrapperService) { }
|
private readonly mastodonService: MastodonWrapperService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
let settings = this.toolsService.getSettings();
|
||||||
|
this.remoteStatusFetchingDisabled = settings.disableRemoteStatusFetching;
|
||||||
|
|
||||||
if (this.refreshEventEmitter) {
|
if (this.refreshEventEmitter) {
|
||||||
this.refreshSubscription = this.refreshEventEmitter.subscribe(() => {
|
this.refreshSubscription = this.refreshEventEmitter.subscribe(() => {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
@ -219,6 +223,8 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async retrieveRemoteThread(status: Status): Promise<Status[]> {
|
private async retrieveRemoteThread(status: Status): Promise<Status[]> {
|
||||||
|
if(this.remoteStatusFetchingDisabled) return [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let url = status.url;
|
let url = status.url;
|
||||||
let splitUrl = url.replace('https://', '').split('/');
|
let splitUrl = url.replace('https://', '').split('/');
|
||||||
|
|
|
@ -51,14 +51,15 @@ export class GlobalSettings {
|
||||||
disableAutofocus = false;
|
disableAutofocus = false;
|
||||||
disableAvatarNotifications = false;
|
disableAvatarNotifications = false;
|
||||||
disableSounds = false;
|
disableSounds = false;
|
||||||
|
disableRemoteStatusFetching = false;
|
||||||
|
|
||||||
notificationSoundFileId: string = '0';
|
notificationSoundFileId: string = '0';
|
||||||
|
|
||||||
contentWarningPolicy: ContentWarningPolicy = new ContentWarningPolicy();
|
contentWarningPolicy: ContentWarningPolicy = new ContentWarningPolicy();
|
||||||
|
|
||||||
columnSwitchingWinAlt = false;
|
columnSwitchingWinAlt = false;
|
||||||
|
|
||||||
accountSettings: AccountSettings[] = [];
|
accountSettings: AccountSettings[] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SettingsStateModel {
|
export interface SettingsStateModel {
|
||||||
|
@ -143,6 +144,7 @@ export class SettingsState {
|
||||||
newSettings.disableSounds = oldSettings.disableSounds;
|
newSettings.disableSounds = oldSettings.disableSounds;
|
||||||
newSettings.notificationSoundFileId = oldSettings.notificationSoundFileId;
|
newSettings.notificationSoundFileId = oldSettings.notificationSoundFileId;
|
||||||
newSettings.columnSwitchingWinAlt = oldSettings.columnSwitchingWinAlt;
|
newSettings.columnSwitchingWinAlt = oldSettings.columnSwitchingWinAlt;
|
||||||
|
newSettings.disableRemoteStatusFetching = oldSettings.disableRemoteStatusFetching;
|
||||||
|
|
||||||
return newSettings;
|
return newSettings;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue