Fix action url update

This commit is contained in:
4eb0da
2023-04-18 11:29:01 +03:00
parent 49394d4b26
commit d60c20682a
@@ -39,33 +39,36 @@
let startTs = -1;
let startCoords: Coords | null = null;
let isChanged = false;
let hasJSAction = false;
if (Array.isArray(actions) && actions?.length) {
for (let i = 0; i < actions.length; ++i) {
const url = actions[i].url;
$: {
if (Array.isArray(actions) && actions?.length) {
for (let i = 0; i < actions.length; ++i) {
const url = actions[i].url;
if (url) {
href = url;
target = actions[i].target || undefined;
break;
if (url) {
href = url;
target = actions[i].target || undefined;
break;
}
}
}
}
if (Array.isArray(actions) && actions?.length && actionCtx.hasAction()) {
href = '';
rootCtx.logError(wrapError(new Error('Actionable element is forbidden inside other actionable element'), {
level: 'warn',
additional: {
actions
}
}));
}
if (Array.isArray(actions) && actions?.length && actionCtx.hasAction()) {
href = '';
rootCtx.logError(wrapError(new Error('Actionable element is forbidden inside other actionable element'), {
level: 'warn',
additional: {
actions
}
}));
}
let hasJSAction = Boolean(customAction);
if (href && !isBuiltinSchema(getUrlSchema(href), rootCtx.getBuiltinProtocols())) {
href = '';
hasJSAction = true;
hasJSAction = Boolean(customAction);
if (href && !isBuiltinSchema(getUrlSchema(href), rootCtx.getBuiltinProtocols())) {
href = '';
hasJSAction = true;
}
}
async function onClick(event: MouseEvent): Promise<void> {