kopia lustrzana https://github.com/cheeaun/phanpy
View transition only after first open
Due to intermittent unknown crashes in browsers, limit view transition to only trigger after the 1st media click open If the page crash, there's no way to know how or why it happens unless I spend time to dig in really deep into the problempull/1214/head
rodzic
ca9490dde3
commit
08dbc35fe9
|
@ -289,8 +289,8 @@ function Media({
|
|||
onClick(e);
|
||||
} else {
|
||||
e.preventDefault();
|
||||
el.style.viewTransitionName = mediaVTN;
|
||||
setTimeout(() => {
|
||||
if (el.dataset.viewTransitioned) {
|
||||
el.style.viewTransitionName = mediaVTN;
|
||||
try {
|
||||
document.startViewTransition(() => {
|
||||
el.style.viewTransitionName = '';
|
||||
|
@ -301,7 +301,9 @@ function Media({
|
|||
el.style.viewTransitionName = '';
|
||||
location.hash = `#${to}`;
|
||||
}
|
||||
}, 1);
|
||||
} else {
|
||||
location.hash = `#${to}`;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
onClick?.(e);
|
||||
|
|
|
@ -122,7 +122,7 @@ msgstr ""
|
|||
#: src/pages/list.jsx:171
|
||||
#: src/pages/public.jsx:116
|
||||
#: src/pages/scheduled-posts.jsx:89
|
||||
#: src/pages/status.jsx:1305
|
||||
#: src/pages/status.jsx:1306
|
||||
#: src/pages/trending.jsx:474
|
||||
msgid "More"
|
||||
msgstr ""
|
||||
|
@ -207,8 +207,8 @@ msgstr ""
|
|||
#: src/pages/catchup.jsx:71
|
||||
#: src/pages/catchup.jsx:1448
|
||||
#: src/pages/catchup.jsx:2061
|
||||
#: src/pages/status.jsx:1024
|
||||
#: src/pages/status.jsx:1651
|
||||
#: src/pages/status.jsx:1025
|
||||
#: src/pages/status.jsx:1652
|
||||
msgid "Replies"
|
||||
msgstr ""
|
||||
|
||||
|
@ -476,7 +476,7 @@ msgstr ""
|
|||
#: src/pages/notifications.jsx:942
|
||||
#: src/pages/scheduled-posts.jsx:259
|
||||
#: src/pages/settings.jsx:90
|
||||
#: src/pages/status.jsx:1392
|
||||
#: src/pages/status.jsx:1393
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1087,7 +1087,7 @@ msgstr ""
|
|||
#: src/pages/list.jsx:321
|
||||
#: src/pages/notifications.jsx:922
|
||||
#: src/pages/search.jsx:561
|
||||
#: src/pages/status.jsx:1425
|
||||
#: src/pages/status.jsx:1426
|
||||
msgid "Show more…"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1357,7 +1357,7 @@ msgstr ""
|
|||
msgid "Filtered"
|
||||
msgstr ""
|
||||
|
||||
#: src/components/media.jsx:477
|
||||
#: src/components/media.jsx:479
|
||||
msgid "Open file"
|
||||
msgstr "Open file"
|
||||
|
||||
|
@ -1492,7 +1492,7 @@ msgstr ""
|
|||
#: src/components/nav-menu.jsx:326
|
||||
#: src/pages/login.jsx:32
|
||||
#: src/pages/login.jsx:199
|
||||
#: src/pages/status.jsx:924
|
||||
#: src/pages/status.jsx:925
|
||||
#: src/pages/welcome.jsx:65
|
||||
msgid "Log in"
|
||||
msgstr ""
|
||||
|
@ -1714,8 +1714,8 @@ msgstr ""
|
|||
#: src/components/poll.jsx:208
|
||||
#: src/components/poll.jsx:210
|
||||
#: src/pages/scheduled-posts.jsx:100
|
||||
#: src/pages/status.jsx:1294
|
||||
#: src/pages/status.jsx:1317
|
||||
#: src/pages/status.jsx:1295
|
||||
#: src/pages/status.jsx:1318
|
||||
msgid "Refresh"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2561,8 +2561,8 @@ msgstr ""
|
|||
#: src/components/timeline.jsx:586
|
||||
#: src/pages/home.jsx:228
|
||||
#: src/pages/notifications.jsx:898
|
||||
#: src/pages/status.jsx:1077
|
||||
#: src/pages/status.jsx:1454
|
||||
#: src/pages/status.jsx:1078
|
||||
#: src/pages/status.jsx:1455
|
||||
msgid "Try again"
|
||||
msgstr ""
|
||||
|
||||
|
@ -3891,90 +3891,90 @@ msgid "NOTE: Push notifications only work for <0>one account</0>."
|
|||
msgstr ""
|
||||
|
||||
#. js-lingui-explicit-id
|
||||
#: src/pages/status.jsx:657
|
||||
#: src/pages/status.jsx:1220
|
||||
#: src/pages/status.jsx:658
|
||||
#: src/pages/status.jsx:1221
|
||||
msgid "post.title"
|
||||
msgstr "Post"
|
||||
|
||||
#: src/pages/status.jsx:911
|
||||
#: src/pages/status.jsx:912
|
||||
msgid "You're not logged in. Interactions (reply, boost, etc) are not possible."
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:931
|
||||
#: src/pages/status.jsx:932
|
||||
msgid "This post is from another instance (<0>{instance}</0>). Interactions (reply, boost, etc) are not possible."
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:959
|
||||
#: src/pages/status.jsx:960
|
||||
msgid "Error: {e}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:966
|
||||
#: src/pages/status.jsx:967
|
||||
msgid "Switch to my instance to enable interactions"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1068
|
||||
#: src/pages/status.jsx:1069
|
||||
msgid "Unable to load replies."
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1180
|
||||
#: src/pages/status.jsx:1181
|
||||
msgid "Back"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1211
|
||||
#: src/pages/status.jsx:1212
|
||||
msgid "Go to main post"
|
||||
msgstr ""
|
||||
|
||||
#. placeholder {0}: ancestors.length
|
||||
#: src/pages/status.jsx:1234
|
||||
#: src/pages/status.jsx:1235
|
||||
msgid "{0} posts above ‒ Go to top"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1281
|
||||
#: src/pages/status.jsx:1344
|
||||
#: src/pages/status.jsx:1282
|
||||
#: src/pages/status.jsx:1345
|
||||
msgid "Switch to Side Peek view"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1345
|
||||
#: src/pages/status.jsx:1346
|
||||
msgid "Switch to Full view"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1363
|
||||
#: src/pages/status.jsx:1364
|
||||
msgid "Show all sensitive content"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1368
|
||||
#: src/pages/status.jsx:1369
|
||||
msgid "Experimental"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1377
|
||||
#: src/pages/status.jsx:1378
|
||||
msgid "Unable to switch"
|
||||
msgstr ""
|
||||
|
||||
#. placeholder {0}: punycode.toUnicode( postInstance, )
|
||||
#: src/pages/status.jsx:1384
|
||||
#: src/pages/status.jsx:1385
|
||||
msgid "Switch to post's instance ({0})"
|
||||
msgstr "Switch to post's instance ({0})"
|
||||
|
||||
#: src/pages/status.jsx:1387
|
||||
#: src/pages/status.jsx:1388
|
||||
msgid "Switch to post's instance"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1445
|
||||
#: src/pages/status.jsx:1446
|
||||
msgid "Unable to load post"
|
||||
msgstr ""
|
||||
|
||||
#. placeholder {0}: replies.length
|
||||
#. placeholder {1}: shortenNumber(replies.length)
|
||||
#: src/pages/status.jsx:1581
|
||||
#: src/pages/status.jsx:1582
|
||||
msgid "{0, plural, one {# reply} other {<0>{1}</0> replies}}"
|
||||
msgstr ""
|
||||
|
||||
#. placeholder {0}: shortenNumber(totalComments)
|
||||
#: src/pages/status.jsx:1599
|
||||
#: src/pages/status.jsx:1600
|
||||
msgid "{totalComments, plural, one {# comment} other {<0>{0}</0> comments}}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/status.jsx:1621
|
||||
#: src/pages/status.jsx:1622
|
||||
msgid "View post with its replies"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -193,6 +193,7 @@ function StatusPage(params) {
|
|||
});
|
||||
transition.ready.finally(() => {
|
||||
el.style.viewTransitionName = '';
|
||||
el.dataset.viewTransitioned = mediaVTN;
|
||||
});
|
||||
} else {
|
||||
mediaClose();
|
||||
|
|
Ładowanie…
Reference in New Issue