Hide "become a sustainer" button if you're already a sustainer

This commit is contained in:
Evan Hahn 2021-11-30 10:29:57 -06:00 committed by GitHub
parent 7edf3763a8
commit 67b17ec317
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 318 additions and 26 deletions

View file

@ -50,6 +50,7 @@ import { initializeAllJobQueues } from './jobs/initializeAllJobQueues';
import { removeStorageKeyJobQueue } from './jobs/removeStorageKeyJobQueue';
import { ourProfileKeyService } from './services/ourProfileKey';
import { notificationService } from './services/notifications';
import { areWeASubscriberService } from './services/areWeASubscriber';
import { shouldRespondWithProfileKey } from './util/shouldRespondWithProfileKey';
import { LatestQueue } from './util/LatestQueue';
import { parseIntOrThrow } from './util/parseIntOrThrow';
@ -346,6 +347,8 @@ export async function startApp(): Promise<void> {
onlineEventTarget: window,
storage: window.storage,
});
areWeASubscriberService.update(window.storage, server);
});
const eventHandlerQueue = new window.PQueue({
@ -3477,6 +3480,11 @@ export async function startApp(): Promise<void> {
log.info('onFetchLatestSync: fetching latest manifest');
await window.Signal.Services.runStorageServiceSyncJob();
break;
case FETCH_LATEST_ENUM.SUBSCRIPTION_STATUS:
log.info('onFetchLatestSync: fetching latest subscription status');
strictAssert(server, 'WebAPI not ready');
areWeASubscriberService.update(window.storage, server);
break;
default:
log.info(`onFetchLatestSync: Unknown type encountered ${eventType}`);
}