Skip to content

Commit

Permalink
chore: update packages (#310)
Browse files Browse the repository at this point in the history
* Update types packages

* Other

* Lint

* Lint 2
  • Loading branch information
charlesfries authored Jun 10, 2024
1 parent dc7b55c commit c619155
Show file tree
Hide file tree
Showing 9 changed files with 3,791 additions and 1,129 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = {
'class-methods-use-this': 'off',
'no-underscore-dangle': 'off',
'ember/use-ember-data-rfc-395-imports': 'off',
'no-restricted-exports': 'off',
},
overrides: [
// node files
Expand Down
3 changes: 2 additions & 1 deletion addon/adapters/cloud-firestore-modular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export default class CloudFirestoreAdapter extends Adapter {
protected referenceKeyName = 'referenceTo';

protected get isFastBoot(): boolean {
const fastboot = getOwner(this).lookup('service:fastboot');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const fastboot = getOwner(this).lookup('service:fastboot') as any;

return fastboot && fastboot.isFastBoot;
}
Expand Down
4 changes: 2 additions & 2 deletions addon/authenticators/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ interface AuthenticateCallback {
}

export default class FirebaseAuthenticator extends BaseAuthenticator {
/* eslint-disable @typescript-eslint/no-explicit-any */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private get fastboot(): any {
return getOwner(this).lookup('service:fastboot');
return getOwner(this)?.lookup('service:fastboot');
}

public async authenticate(callback: AuthenticateCallback): Promise<{ user: User | null }> {
Expand Down
8 changes: 6 additions & 2 deletions addon/instance-initializers/firebase-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ interface AddonConfig {
storage?: StorageAddonConfig;
}

interface Config {
'ember-cloud-firestore-adapter': AddonConfig;
}

function getDb(app: FirebaseApp, config: FirestoreAddonConfig): Firestore {
if (config.settings) {
return initializeFirestore(app, config.settings);
Expand Down Expand Up @@ -116,8 +120,8 @@ function setupModularInstance(config: AddonConfig) {
}

export function initialize(appInstance: ApplicationInstance): void {
const config = appInstance.resolveRegistration('config:environment');
const addonConfig: AddonConfig = config['ember-cloud-firestore-adapter'];
const config = appInstance.resolveRegistration('config:environment') as Config;
const addonConfig = config['ember-cloud-firestore-adapter'];

try {
setupModularInstance(addonConfig);
Expand Down
4 changes: 2 additions & 2 deletions addon/session-stores/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { getOwner } from '@ember/application';
import LocalStorageStore from 'ember-simple-auth/session-stores/local-storage';

export default class FirebaseStore extends LocalStorageStore {
/* eslint-disable @typescript-eslint/no-explicit-any */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private get fastboot(): any {
return getOwner(this).lookup('service:fastboot');
return getOwner(this)?.lookup('service:fastboot');
}

public restore(): Promise<unknown> {
Expand Down
Loading

0 comments on commit c619155

Please sign in to comment.