[auth] Move useDeviceLanguage to unsupported method

This commit is contained in:
Elliot Hesp 2018-01-06 15:14:11 +00:00
parent f970d882ba
commit 9ea0a5cc7f
2 changed files with 6 additions and 15 deletions

5
lib/index.d.ts vendored
View File

@ -714,11 +714,6 @@ declare module "react-native-firebase" {
*/
signOut(): Promise<void>
/**
* Sets the language for the auth instance to the device language
*/
useDeviceLanguage(): void
[key: string]: any;
}
}

View File

@ -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 = {