mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
refactor: Improve Ionic Native warnings (#2611)
- Explicitly spell out that this is coming from "Ionic Native", instead of just "Native" - Improve sentence that explains 2 most common reasons for missing Cordova
This commit is contained in:
parent
3b32e19bf1
commit
c6713862c5
@ -53,7 +53,7 @@ export const pluginWarn = (
|
||||
): void => {
|
||||
if (method) {
|
||||
console.warn(
|
||||
'Native: tried calling ' +
|
||||
'Ionic Native: tried calling ' +
|
||||
pluginName +
|
||||
'.' +
|
||||
method +
|
||||
@ -63,12 +63,12 @@ export const pluginWarn = (
|
||||
);
|
||||
} else {
|
||||
console.warn(
|
||||
`'Native: tried accessing the ${pluginName} plugin but it's not installed.`
|
||||
`'Ionic Native: tried accessing the ${pluginName} plugin but it's not installed.`
|
||||
);
|
||||
}
|
||||
if (plugin) {
|
||||
console.warn(
|
||||
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
|
||||
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
|
||||
);
|
||||
}
|
||||
};
|
||||
@ -81,17 +81,17 @@ export const pluginWarn = (
|
||||
export const cordovaWarn = (pluginName: string, method?: string): void => {
|
||||
if (method) {
|
||||
console.warn(
|
||||
'Native: tried calling ' +
|
||||
'Ionic Native: tried calling ' +
|
||||
pluginName +
|
||||
'.' +
|
||||
method +
|
||||
', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
|
||||
', but Cordova is not available. Make sure to a) run in a real device or simulator and b) include cordova.js in your index.html'
|
||||
);
|
||||
} else {
|
||||
console.warn(
|
||||
'Native: tried accessing the ' +
|
||||
pluginName +
|
||||
' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
|
||||
' plugin but Cordova is not available. Make sure to a) run in a real device or simulator and b) include cordova.js in your index.html'
|
||||
);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user