Skip to content

Commit

Permalink
clean up unused ServiceWorkerState
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasten2 committed Dec 4, 2023
1 parent e4b785f commit fc8f047
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
1 change: 0 additions & 1 deletion __test__/support/mocks/models/MockServiceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import NotImplementedError from '../../../../src/shared/errors/NotImplementedErr

export class MockServiceWorker implements ServiceWorker {
scriptURL: string;
state: ServiceWorkerState;

constructor() {}

Expand Down
5 changes: 0 additions & 5 deletions src/shared/models/ServiceWorkerState.ts

This file was deleted.

26 changes: 0 additions & 26 deletions src/shared/services/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
OutcomesNotificationClicked,
OutcomesNotificationReceived,
} from '../models/OutcomesNotificationEvents';
import { ServiceWorkerState } from '../models/ServiceWorkerState';
import { Subscription } from '../models/Subscription';
import { Session, ONESIGNAL_SESSION_KEY } from '../models/Session';
import Log from '../libraries/Log';
Expand Down Expand Up @@ -247,23 +246,6 @@ export default class Database {
}
}

async getServiceWorkerState(): Promise<ServiceWorkerState> {
const state = new ServiceWorkerState();
state.workerVersion = await this.get<number>(
'Ids',
'WORKER1_ONE_SIGNAL_SW_VERSION',
);
return state;
}

async setServiceWorkerState(state: ServiceWorkerState) {
if (state.workerVersion)
await this.put('Ids', {
type: 'WORKER1_ONE_SIGNAL_SW_VERSION',
id: state.workerVersion,
});
}

async getSubscription(): Promise<Subscription> {
const subscription = new Subscription();
subscription.deviceId = await this.get<string>('Ids', 'userId');
Expand Down Expand Up @@ -534,14 +516,6 @@ export default class Database {
return await Database.singletonInstance.getConsentGiven();
}

static async setServiceWorkerState(workerState: ServiceWorkerState) {
return await Database.singletonInstance.setServiceWorkerState(workerState);
}

static async getServiceWorkerState(): Promise<ServiceWorkerState> {
return await Database.singletonInstance.getServiceWorkerState();
}

static async setAppState(appState: AppState) {
return await Database.singletonInstance.setAppState(appState);
}
Expand Down

0 comments on commit fc8f047

Please sign in to comment.