Changeset View
Changeset View
Standalone View
Standalone View
web/database/database-module-provider.js
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | userLoggedIn(currentLoggedInUserID: ?string) { | ||||
if ( | if ( | ||||
this.status === databaseStatuses.notSupported && | this.status === databaseStatuses.notSupported && | ||||
isSQLiteSupported(currentLoggedInUserID) | isSQLiteSupported(currentLoggedInUserID) | ||||
) { | ) { | ||||
this.init(); | this.init(); | ||||
} | } | ||||
} | } | ||||
async clearSensitiveData(): Promise<void> { | |||||
this.status = databaseStatuses.notSupported; | |||||
kamil: clearing database means that there is no user - and we do not support database for anonymous… | |||||
tomekUnsubmitted Not Done Inline ActionsThis is a little confusing as notSupported should mean that e.g. a db can't be created on this device due to e.g. technical limitations. But it may make sense to keep this name if it would be handled in the same way as our current not supported status. tomek: This is a little confusing as `notSupported` should mean that e.g. a db can't be created on… | |||||
await this.workerProxy.scheduleOnWorker({ | |||||
type: workerRequestMessageTypes.CLEAR_SENSITIVE_DATA, | |||||
}); | |||||
} | |||||
async isDatabaseWorkable(): Promise<boolean> { | |||||
if (this.status === databaseStatuses.initInProgress) { | |||||
await this.initPromise; | |||||
} | |||||
return this.status === databaseStatuses.initSuccess; | |||||
} | |||||
async schedule( | async schedule( | ||||
payload: WorkerRequestMessage, | payload: WorkerRequestMessage, | ||||
): Promise<?WorkerResponseMessage> { | ): Promise<?WorkerResponseMessage> { | ||||
if (this.status === databaseStatuses.notSupported) { | if (this.status === databaseStatuses.notSupported) { | ||||
throw new Error('Database not supported'); | throw new Error('Database not supported'); | ||||
} | } | ||||
if (this.status === databaseStatuses.initInProgress) { | if (this.status === databaseStatuses.initInProgress) { | ||||
Show All 14 Lines |
clearing database means that there is no user - and we do not support database for anonymous users