mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-29 22:59:20 +09:00
fix: devビルドでURLプレビューに失敗した場合に起こる不具合を修正 (MisskeyIO#139)
This commit is contained in:
parent
2445f6635c
commit
42a90f56e1
@ -142,8 +142,8 @@ window.fetch(`/url?url=${encodeURIComponent(requestUrl.href)}&lang=${versatileLa
|
|||||||
|
|
||||||
return res.json();
|
return res.json();
|
||||||
})
|
})
|
||||||
.then((info: SummalyResult) => {
|
.then((info?: SummalyResult) => {
|
||||||
if (info.url == null) {
|
if (!info?.url) {
|
||||||
fetching = false;
|
fetching = false;
|
||||||
unknownUrl = true;
|
unknownUrl = true;
|
||||||
return;
|
return;
|
||||||
|
@ -27,12 +27,16 @@ let top = $ref(0);
|
|||||||
let left = $ref(0);
|
let left = $ref(0);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
try {
|
||||||
const rect = props.source.getBoundingClientRect();
|
const rect = props.source.getBoundingClientRect();
|
||||||
const x = Math.max((rect.left + (props.source.offsetWidth / 2)) - (300 / 2), 6) + window.pageXOffset;
|
const x = Math.max((rect.left + (props.source.offsetWidth / 2)) - (300 / 2), 6) + window.pageXOffset;
|
||||||
const y = rect.top + props.source.offsetHeight + window.pageYOffset;
|
const y = rect.top + props.source.offsetHeight + window.pageYOffset;
|
||||||
|
|
||||||
top = y;
|
top = y;
|
||||||
left = x;
|
left = x;
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user