mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
chore(repo): prune dead code and duplicate abstractions (#3413)
This commit is contained in:
1 parent
c17091768c
commit
c9fdf8fead
2937 files changed
+42233
-176793
No files matched your search
@@ -3,7 +3,7 @@
|
||||
import {runtimeInstanceKey} from '@app/features/app/state/InstanceSnapshotStore';
|
||||
import RuntimeConfig from '@app/features/app/state/RuntimeConfig';
|
||||
import {Logger} from '@app/features/platform/utils/AppLogger';
|
||||
import {AGE_BLOCKED_GEOS, AGE_RESTRICTED_GEOS} from '@fluxer/instance_bootstrap/src/AgeGeos';
|
||||
import {AGE_RESTRICTED_GEOS} from '@fluxer/instance_bootstrap/src/AgeGeos';
|
||||
import type {GeoEntry, GeolocationResponse, InstanceAgePolicy} from '@fluxer/instance_bootstrap/src/Types';
|
||||
import {compareStructural, makeAutoObservable, reaction, runInAction} from 'mobx';
|
||||
|
||||
@@ -21,7 +21,6 @@ interface ConnectionGeo {
|
||||
|
||||
interface AgeTables {
|
||||
restricted: ReadonlyArray<GeoEntry>;
|
||||
blocked: ReadonlyArray<GeoEntry>;
|
||||
}
|
||||
|
||||
interface ActiveRuntimeContext {
|
||||
@@ -32,19 +31,16 @@ interface ActiveRuntimeContext {
|
||||
|
||||
function ageTablesFor(policy: InstanceAgePolicy | null): AgeTables {
|
||||
if (policy == null) {
|
||||
return {restricted: AGE_RESTRICTED_GEOS, blocked: AGE_BLOCKED_GEOS};
|
||||
return {restricted: AGE_RESTRICTED_GEOS};
|
||||
}
|
||||
const restricted: Array<GeoEntry> = [];
|
||||
const blocked: Array<GeoEntry> = [];
|
||||
for (const geo of policy.geos) {
|
||||
const entry: GeoEntry = {countryCode: geo.country_code, regionCode: geo.region_code};
|
||||
if (geo.action === 'block') {
|
||||
blocked.push(entry);
|
||||
} else {
|
||||
if (geo.action !== 'block') {
|
||||
restricted.push(entry);
|
||||
}
|
||||
}
|
||||
return {restricted, blocked};
|
||||
return {restricted};
|
||||
}
|
||||
|
||||
function activeRuntimeContext(): ActiveRuntimeContext | null {
|
||||
@@ -86,7 +82,6 @@ class GeoIP {
|
||||
latitude: string | null = null;
|
||||
longitude: string | null = null;
|
||||
ageRestrictedGeos: ReadonlyArray<GeoEntry> = AGE_RESTRICTED_GEOS;
|
||||
ageBlockedGeos: ReadonlyArray<GeoEntry> = AGE_BLOCKED_GEOS;
|
||||
resolution: GeoIPResolution = 'pending';
|
||||
private generation = 0;
|
||||
private instanceKey: string | null = null;
|
||||
@@ -173,7 +168,6 @@ class GeoIP {
|
||||
|
||||
private applyAgeTables(tables: AgeTables): void {
|
||||
this.ageRestrictedGeos = tables.restricted;
|
||||
this.ageBlockedGeos = tables.blocked;
|
||||
}
|
||||
|
||||
private async resolve(): Promise<void> {
|
||||
|
||||
Reference in new issue
Block a user