mirror of
https://github.com/NicolasConstant/sengi
synced 2025-02-02 19:46:59 +01:00
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>
|
||||
</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>
|
||||
<p class="version">
|
||||
Sengi version: {{version}}<br />
|
||||
|
@ -21,6 +21,7 @@ export class SettingsComponent implements OnInit {
|
||||
notificationForm: FormGroup;
|
||||
|
||||
disableAutofocusEnabled: boolean;
|
||||
disableRemoteStatusFetchingEnabled: boolean;
|
||||
disableAvatarNotificationsEnabled: boolean;
|
||||
disableSoundsEnabled: boolean;
|
||||
version: string;
|
||||
@ -78,6 +79,7 @@ export class SettingsComponent implements OnInit {
|
||||
this.disableAutofocusEnabled = settings.disableAutofocus;
|
||||
this.disableAvatarNotificationsEnabled = settings.disableAvatarNotifications;
|
||||
this.disableSoundsEnabled = settings.disableSounds;
|
||||
this.disableRemoteStatusFetchingEnabled = settings.disableRemoteStatusFetching;
|
||||
|
||||
if (!settings.columnSwitchingWinAlt) {
|
||||
this.columnShortcutEnabled = ColumnShortcut.Ctrl;
|
||||
@ -172,6 +174,12 @@ export class SettingsComponent implements OnInit {
|
||||
this.toolsService.saveSettings(settings);
|
||||
}
|
||||
|
||||
onDisableRemoteStatusFetchingChanged() {
|
||||
let settings = this.toolsService.getSettings();
|
||||
settings.disableRemoteStatusFetching = this.disableRemoteStatusFetchingEnabled;
|
||||
this.toolsService.saveSettings(settings);
|
||||
}
|
||||
|
||||
onDisableAvatarNotificationsChanged() {
|
||||
let settings = this.toolsService.getSettings();
|
||||
settings.disableAvatarNotifications = this.disableAvatarNotificationsEnabled;
|
||||
|
@ -22,6 +22,7 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||
isLoading = true;
|
||||
isThread = true;
|
||||
hasContentWarnings = false;
|
||||
private remoteStatusFetchingDisabled = false;
|
||||
|
||||
bufferStream: Status[] = []; //html compatibility only
|
||||
|
||||
@ -57,6 +58,9 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||
private readonly mastodonService: MastodonWrapperService) { }
|
||||
|
||||
ngOnInit() {
|
||||
let settings = this.toolsService.getSettings();
|
||||
this.remoteStatusFetchingDisabled = settings.disableRemoteStatusFetching;
|
||||
|
||||
if (this.refreshEventEmitter) {
|
||||
this.refreshSubscription = this.refreshEventEmitter.subscribe(() => {
|
||||
this.refresh();
|
||||
@ -219,6 +223,8 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private async retrieveRemoteThread(status: Status): Promise<Status[]> {
|
||||
if(this.remoteStatusFetchingDisabled) return [];
|
||||
|
||||
try {
|
||||
let url = status.url;
|
||||
let splitUrl = url.replace('https://', '').split('/');
|
||||
|
@ -51,14 +51,15 @@ export class GlobalSettings {
|
||||
disableAutofocus = false;
|
||||
disableAvatarNotifications = false;
|
||||
disableSounds = false;
|
||||
|
||||
disableRemoteStatusFetching = false;
|
||||
|
||||
notificationSoundFileId: string = '0';
|
||||
|
||||
contentWarningPolicy: ContentWarningPolicy = new ContentWarningPolicy();
|
||||
|
||||
columnSwitchingWinAlt = false;
|
||||
|
||||
accountSettings: AccountSettings[] = [];
|
||||
accountSettings: AccountSettings[] = [];
|
||||
}
|
||||
|
||||
export interface SettingsStateModel {
|
||||
@ -143,6 +144,7 @@ export class SettingsState {
|
||||
newSettings.disableSounds = oldSettings.disableSounds;
|
||||
newSettings.notificationSoundFileId = oldSettings.notificationSoundFileId;
|
||||
newSettings.columnSwitchingWinAlt = oldSettings.columnSwitchingWinAlt;
|
||||
newSettings.disableRemoteStatusFetching = oldSettings.disableRemoteStatusFetching;
|
||||
|
||||
return newSettings;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user