Skip to content

Commit

Permalink
fix: vue 3 log warning causes error on iOS (#7364)
Browse files Browse the repository at this point in the history
Co-authored-by: Szymon Stasik <ciekawy@gmail.com>
Co-authored-by: Mark Anderson <mark@ionic.io>
  • Loading branch information
3 people authored Mar 22, 2024
1 parent f8f2322 commit bc39b6b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
12 changes: 6 additions & 6 deletions android/capacitor/src/main/assets/native-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,15 @@ var nativeBridge = (function (exports) {
typeof c.dir === 'function');
};
const serializeConsoleMessage = (msg) => {
if (typeof msg === 'object') {
try {
try {
if (typeof msg === 'object') {
msg = JSON.stringify(msg);
}
catch (e) {
// ignore
}
return String(msg);
}
catch (e) {
return '';
}
return String(msg);
};
const platform = getPlatformId(win);
if (platform == 'android' || platform == 'ios') {
Expand Down
11 changes: 5 additions & 6 deletions core/native-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,14 @@ const initBridge = (w: any): void => {
};

const serializeConsoleMessage = (msg: any): string => {
if (typeof msg === 'object') {
try {
try {
if (typeof msg === 'object') {
msg = JSON.stringify(msg);
} catch (e) {
// ignore
}
return String(msg);
} catch (e) {
return '';
}

return String(msg);
};

const platform = getPlatformId(win);
Expand Down
12 changes: 6 additions & 6 deletions ios/Capacitor/Capacitor/assets/native-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,15 @@ var nativeBridge = (function (exports) {
typeof c.dir === 'function');
};
const serializeConsoleMessage = (msg) => {
if (typeof msg === 'object') {
try {
try {
if (typeof msg === 'object') {
msg = JSON.stringify(msg);
}
catch (e) {
// ignore
}
return String(msg);
}
catch (e) {
return '';
}
return String(msg);
};
const platform = getPlatformId(win);
if (platform == 'android' || platform == 'ios') {
Expand Down

0 comments on commit bc39b6b

Please sign in to comment.