From 9ea0a5cc7fbcbf4bd6d672b1bc0c80fdb69b7ab6 Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Sat, 6 Jan 2018 15:14:11 +0000 Subject: [PATCH] [auth] Move useDeviceLanguage to unsupported method --- lib/index.d.ts | 5 ----- lib/modules/auth/index.js | 16 ++++++---------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 2b4b17bc..f5e42abf 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -714,11 +714,6 @@ declare module "react-native-firebase" { */ signOut(): Promise - /** - * Sets the language for the auth instance to the device language - */ - useDeviceLanguage(): void - [key: string]: any; } } diff --git a/lib/modules/auth/index.js b/lib/modules/auth/index.js index 1ea2c312..23524d75 100644 --- a/lib/modules/auth/index.js +++ b/lib/modules/auth/index.js @@ -48,7 +48,7 @@ export default class Auth extends ModuleBase { }); this._user = null; this._authResult = null; - this._languageCode = this._native.APP_LANGUAGE[firebaseApp._name] || null; + this._languageCode = getNativeModule(this).APP_LANGUAGE[app._name] || null; SharedEventEmitter.addListener( // sub to internal native event - this fans out to @@ -335,14 +335,6 @@ export default class Auth extends ModuleBase { return getNativeModule(this).fetchProvidersForEmail(email); } - /** - * Sets the language for the auth module using the device language - * @returns {*} - */ - useDeviceLanguage() { - this._native.useDeviceLanguage(); - } - /** * Sets the language for the auth module * @param code @@ -350,7 +342,7 @@ export default class Auth extends ModuleBase { */ set languageCode(code: string) { this._languageCode = code; - this._native.setLanguageCode(code); + getNativeModule(this).setLanguageCode(code); } /** @@ -392,6 +384,10 @@ export default class Auth extends ModuleBase { signInWithRedirect() { throw new Error(INTERNALS.STRINGS.ERROR_UNSUPPORTED_MODULE_METHOD('auth', 'signInWithRedirect')); } + + useDeviceLanguage() { + throw new Error(INTERNALS.STRINGS.ERROR_UNSUPPORTED_MODULE_METHOD('auth', 'useDeviceLanguage')); + } } export const statics = {