Compare commits
6 Commits
344a3067fa
...
v1.19.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
5c71523d90
|
|||
|
bea1b97fb7
|
|||
|
6ba1cf31cf
|
|||
|
9cdd021cda
|
|||
|
ef53870b35
|
|||
|
918a794784
|
@@ -142,10 +142,12 @@ export default class PlaceDetails extends Component {
|
||||
|
||||
if (type === 'phone') {
|
||||
return htmlSafe(
|
||||
parts.map((p) => {
|
||||
const safeTel = p.replace(/[\s-]+/g, '');
|
||||
return `<a href="tel:${safeTel}">${p}</a>`;
|
||||
}).join('<br>')
|
||||
parts
|
||||
.map((p) => {
|
||||
const safeTel = p.replace(/[\s-]+/g, '');
|
||||
return `<a href="tel:${safeTel}">${p}</a>`;
|
||||
})
|
||||
.join('<br>')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -157,10 +159,12 @@ export default class PlaceDetails extends Component {
|
||||
|
||||
if (type === 'whatsapp') {
|
||||
return htmlSafe(
|
||||
parts.map((p) => {
|
||||
const safeTel = p.replace(/[\s-]+/g, '');
|
||||
return `<a href="https://wa.me/${safeTel}" target="_blank" rel="noopener noreferrer">${p}</a>`;
|
||||
}).join('<br>')
|
||||
parts
|
||||
.map((p) => {
|
||||
const safeTel = p.replace(/[\s-]+/g, '');
|
||||
return `<a href="https://wa.me/${safeTel}" target="_blank" rel="noopener noreferrer">${p}</a>`;
|
||||
})
|
||||
.join('<br>')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export default class UserMenuComponent extends Component {
|
||||
@action
|
||||
connectRS() {
|
||||
this.args.onClose();
|
||||
this.args.storage.connect();
|
||||
this.args.storage.showConnectWidget();
|
||||
}
|
||||
|
||||
@action
|
||||
|
||||
@@ -46,6 +46,14 @@ export default class StorageService extends Service {
|
||||
// console.debug('[rs] client ready');
|
||||
});
|
||||
|
||||
this.rs.on('error', (error) => {
|
||||
if (!error) return;
|
||||
console.info('[rs] Error —', `${error.name}: ${error.message}`);
|
||||
if (error.name === 'Unauthorized') {
|
||||
this.showConnectWidget();
|
||||
}
|
||||
});
|
||||
|
||||
this.rs.on('connected', () => {
|
||||
this.connected = true;
|
||||
this.userAddress = this.rs.remote.userAddress;
|
||||
@@ -445,7 +453,7 @@ export default class StorageService extends Service {
|
||||
}
|
||||
|
||||
@action
|
||||
connect() {
|
||||
showConnectWidget() {
|
||||
this.isWidgetOpen = true;
|
||||
|
||||
// Check if widget is already attached
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "marco",
|
||||
"version": "1.18.4",
|
||||
"version": "1.19.1",
|
||||
"private": true,
|
||||
"description": "Unhosted maps app",
|
||||
"repository": {
|
||||
@@ -87,7 +87,7 @@
|
||||
"prettier-plugin-ember-template-tag": "^2.1.2",
|
||||
"qunit": "^2.25.0",
|
||||
"qunit-dom": "^3.5.0",
|
||||
"remotestorage-widget": "^1.8.0",
|
||||
"remotestorage-widget": "^1.8.1",
|
||||
"remotestoragejs": "2.0.0-beta.8",
|
||||
"sinon": "^21.0.1",
|
||||
"stylelint": "^16.26.1",
|
||||
|
||||
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -166,8 +166,8 @@ importers:
|
||||
specifier: ^3.5.0
|
||||
version: 3.5.0
|
||||
remotestorage-widget:
|
||||
specifier: ^1.8.0
|
||||
version: 1.8.0
|
||||
specifier: ^1.8.1
|
||||
version: 1.8.1
|
||||
remotestoragejs:
|
||||
specifier: 2.0.0-beta.8
|
||||
version: 2.0.0-beta.8
|
||||
@@ -4564,8 +4564,8 @@ packages:
|
||||
resolution: {integrity: sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==}
|
||||
hasBin: true
|
||||
|
||||
remotestorage-widget@1.8.0:
|
||||
resolution: {integrity: sha512-l8AE2npC2nNkC8bAU6WhWO5Wl4exaXbE2yR82s5Oiqg6h0KN2mYwvLLTQGkp6mSmZTA86e7XaOcNp4lXS8CsBA==}
|
||||
remotestorage-widget@1.8.1:
|
||||
resolution: {integrity: sha512-HxNu2VvIRW3wzkf5fLEzs56ySQ7+YQbRqyp3CKvmw/G+zKhRsmj06HtFoAcm3B14/nJh2SOAv3LyfKuXfUsKPw==}
|
||||
|
||||
remotestoragejs@2.0.0-beta.8:
|
||||
resolution: {integrity: sha512-rtyHTG2VbtiKTRmbwjponRf5VTPJMcHv/ijNid1zX48C0Z0F8ZCBBfkKD2QCxTQyQvCupkWNy3wuIu4HE+AEng==}
|
||||
@@ -10648,7 +10648,7 @@ snapshots:
|
||||
dependencies:
|
||||
jsesc: 3.1.0
|
||||
|
||||
remotestorage-widget@1.8.0: {}
|
||||
remotestorage-widget@1.8.1: {}
|
||||
|
||||
remotestoragejs@2.0.0-beta.8:
|
||||
dependencies:
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
release/assets/main-BVEi_-zb.js
Normal file
2
release/assets/main-BVEi_-zb.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -39,7 +39,7 @@
|
||||
<meta name="msapplication-TileColor" content="#F6E9A6">
|
||||
<meta name="msapplication-TileImage" content="/icons/icon-144.png">
|
||||
|
||||
<script type="module" crossorigin src="/assets/main-0ky279gM.js"></script>
|
||||
<script type="module" crossorigin src="/assets/main-BVEi_-zb.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/main-BF2Ls-fG.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -318,15 +318,17 @@ module('Integration | Component | place-details', function (hooks) {
|
||||
assert.ok(whatsappBlock, 'WhatsApp block is rendered');
|
||||
|
||||
const links = whatsappBlock.querySelectorAll('a[href^="https://wa.me/"]');
|
||||
assert.strictEqual(
|
||||
links.length,
|
||||
2,
|
||||
'Rendered exactly 2 WhatsApp links'
|
||||
);
|
||||
assert.strictEqual(links.length, 2, 'Rendered exactly 2 WhatsApp links');
|
||||
|
||||
// Verify it stripped the dashes and spaces for the wa.me URL
|
||||
assert.strictEqual(links[0].getAttribute('href'), 'https://wa.me/+44987654321');
|
||||
assert.strictEqual(links[1].getAttribute('href'), 'https://wa.me/+12345678900');
|
||||
assert.strictEqual(
|
||||
links[0].getAttribute('href'),
|
||||
'https://wa.me/+44987654321'
|
||||
);
|
||||
assert.strictEqual(
|
||||
links[1].getAttribute('href'),
|
||||
'https://wa.me/+12345678900'
|
||||
);
|
||||
|
||||
// Verify it kept the dashes and spaces for the visible text
|
||||
assert.dom(links[0]).hasText('+44 987 654 321');
|
||||
|
||||
Reference in New Issue
Block a user