Commit 0fb3e190 authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 1c12b52c
......@@ -6,6 +6,7 @@
"ng": "ng",
"start": "ng serve --aot",
"build": "ng build --i18n-locale zh-CN --base-href /mobile/ --prod",
"build:dev": "ng build --i18n-locale zh-CN --base-href /mobile2/ --prod",
"postinstall": "patch -i webpack.patch -p0 -t",
"lint": "ng lint"
},
......
......@@ -41,9 +41,7 @@ export class NewRoomComponent {
}
share(host_password: string) {
return navigator.share({
text: '房间密码是' + host_password
});
this.ygopro.share('房间密码是' + host_password);
}
set_start_lp() {
......
......@@ -396,6 +396,15 @@ export class YGOProService {
alert(JSON.stringify({ method: 'backHome', params: [] }));
}
}
share(text: string) {
try {
window.ygopro.share(text);
} catch (error) {
console.error(error);
alert(JSON.stringify({ method: 'share', params: [text] }));
}
}
}
type Message =
......
......@@ -14,6 +14,7 @@ interface Window {
openDrawer(): void;
backHome(): void;
share(text: string): void
updateUser(name: string, avatar: string, status: string): void;
readFile(path: string): string;
......@@ -25,6 +26,6 @@ interface Window {
};
}
interface Navigator {
share: (options: { title?: string; text?: string; url?: string }) => Promise<{}>;
}
// interface Navigator {
// share: (options: { title?: string; text?: string; url?: string }) => Promise<{}>;
// }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment